← Back to index
|
Original Bugzilla link
Bug 5526 – Static templated functions don't work with CTFE
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-02-05T01:15:00Z
Last change time
2015-06-09T05:11:35Z
Keywords
rejects-valid
Assigned to
nobody
Creator
dlang-bugzilla
Comments
Comment #0
by dlang-bugzilla — 2011-02-05T01:15:15Z
string g(string who)() { return "Hello, "~who~"!"; } struct S { static string f () { return "Hello, world!"; } static string g(string who)() { return "Hello, "~who~"!"; } } void main() { pragma(msg, S.f()); // works pragma(msg, g!("world")()); // works pragma(msg, S.g!("world")()); // doesn't work } === Compiler output === $ dmd test.d Hello, world! Hello, world! test.d(13): Error: Cannot interpret S at compile time test.d(13): Error: cannot evaluate (S , g)() at compile time (S , g)()
Comment #1
by dlang-bugzilla — 2011-02-16T15:40:22Z
Oops, I stumbled upon the exact same bug a while ago. *** This issue has been marked as a duplicate of issue 3959 ***