http://d.puremagic.com/issues/show_bug.cgi?id=2849
Andrej Mitrovic <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #2 from Andrej Mitrovic <[email protected]> 2012-12-25 08:06:48 PST --- (In reply to comment #1) > It's because it doesn't try to const fold it. In this case, > the init value is constant, so it could possibly work. In other cases, > it could be initialized from something non-constant (eg, a function > parameter). Regardless, it should say that it's not constant, rather > than just that it's not a valid template parameter. That first sample now works, but w.r.t. errors I can't reproduce the bad error message. E.g.: struct bar (int n){} void main() { char[] x = "bug".dup; bar!(x.length) z; } test.d(5): Error: variable x cannot be read at compile time test.d(5): Error: expression x.length is not a valid template value argument test.d(5): Error: template instance test.bar!(x.length) error instantiating Fixed? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
