Bug 4537 – Confusing error message when foreach lacks semicolon (;)

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2010-07-30T13:05:00Z
Last change time
2013-01-20T13:27:13Z
Keywords
diagnostic
Assigned to
nobody
Creator
tomeksowi

Comments

Comment #0 by tomeksowi — 2010-07-30T13:05:00Z
import std.stdio; import std.range; void main() { foreach (c, take(repeat('-'), 4)) write(c); } I just spent a good minute trying to decypher the error message: test.d(6): basic type expected, not 45U test.d(6): found '45U' when expecting ')' test.d(6): basic type expected, not 4 test.d(6): no identifier for declarator int test.d(6): found '4' when expecting ';' test.d(6): expression expected, not ')' I'd expect something like "if there's no ; then it's no good". BTW, what's that 45U?
Comment #1 by bearophile_hugs — 2010-07-30T14:59:55Z
See bug 3818 too.
Comment #2 by andrej.mitrovich — 2013-01-20T13:27:13Z
*** This issue has been marked as a duplicate of issue 3818 ***