[Issue 5969] New: Poor error message for foreach over type tuple
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon May 9 08:23:36 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5969
Summary: Poor error message for foreach over type tuple
Product: D
Version: D1 & D2
Platform: Other
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: clugdbug at yahoo.com.au
--- Comment #0 from Don <clugdbug at yahoo.com.au> 2011-05-09 08:19:38 PDT ---
This code fails with a back-end error:
test.d(7): Error: type Foo is not an expression
struct Foo {
int a;
}
int foo()
{
foreach (f; Foo.tupleof)
{}
return 1;
}
//static assert(foo());
It should be a front-end error. If you uncomment the static assert, you get a
cryptic "cannot interpret Foo at compile time" error.
But the error should have been detected before CTFE was initiated.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list