[Issue 8285] Error passing CTFE-generated string slice to template value parameter
kenji hara
k.hara.pg at gmail.com
Mon Jun 25 03:23:15 PDT 2012
Direct replying to this news group/mailing list is no meaning.
You must post these test case from the form in bugzilla.
http://d.puremagic.com/issues/show_bug.cgi?id=8285
Kenji hara
2012/6/25 Max Samukha <maxsamukha at gmail.com>:
> Another test case. The error is different but the root cause must be the
> same.
>
> string bar()
>
> {
> string s = "ab";
> return s[0..$];
> }
>
> template T1()
> {
> enum T1 = bar()[0..$]; // error
> }
>
> string baz()
> {
> return T1!();
> }
>
> string foo(string s)
> {
> return s;
> }
>
> static assert(foo(baz()) == "ab");
>
> void main()
> {
> }
>
> Error: variable __dollar cannot be read at compile time
>
More information about the Digitalmars-d-bugs
mailing list