[Issue 2841] char[] template value arguments broken in D2

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 16 08:48:42 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2841


clugdbug at yahoo.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|regression                  |major
           Keywords|rejects-valid               |spec




------- Comment #2 from clugdbug at yahoo.com.au  2009-04-16 10:48 -------
(In reply to comment #1)
> Um,
> 
> string literals are invariant(char)[].

Indeed.

> The error message sure sucks, but it's not surprising that this doesn't work.

But there is no way that a mutable char [] could be passed as a template value
parameter. And it's not a type. So what is
template(char[] X) ?

int foo(char[] c)() { return 0; }

void main(){
   char [] z;
   int a = foo!(z)(); // ok
}

I can't see anything in the spec to indicate what this means. From the
.mangleof, it seems to be accepting it as an alias parameter.

OK, I'll change this to a spec error.


-- 



More information about the Digitalmars-d-bugs mailing list