[Issue 13768] New: Refused template method instantiation with enum struct field
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Nov 23 05:20:56 PST 2014
https://issues.dlang.org/show_bug.cgi?id=13768
Issue ID: 13768
Summary: Refused template method instantiation with enum struct
field
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Keywords: rejects-valid
Severity: enhancement
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: bearophile_hugs at eml.cc
struct Foo {
immutable x = 0;
void bar(int y)() {}
}
void main() {
enum f = Foo();
enum x2 = f.x;
f.bar!(x2); // OK
f.bar!(f.x); // Error
}
dmd 2.067alpha:
test.d(9,6): Error: template instance bar!(x) does not match template
declaration bar(int y)()
--
More information about the Digitalmars-d-bugs
mailing list