[Issue 3792] Regression: "non-constant expression" for a template inside a struct using a struct initializer
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jun 24 13:55:16 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3792
--- Comment #7 from Don <clugdbug at yahoo.com.au> 2010-06-24 13:55:11 PDT ---
The D2 version of this code never compiled without error.
struct S {
int x;
template T(int val) {
enum S T = { x: val };
}
}
const x = S.T!(0);
It fails to compile because init.c, StructInitializer::toExpression() returns
NULL if any of the fields have names ( if (field.data[i]) goto Lno; )
And this is just because it's never been implemented.
--
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