Okay, what happened to my literal strings?

BCS ao at pathlink.com
Thu Sep 6 13:29:09 PDT 2007


Reply to Burton,

> So I just installed DMD 2.004 (I thought I had a DMD 2.0 version
> already installed), and now, no matter which DMD 2.0 I install
> (removing the dmd and dm directories first), this code fails:
> 
> 'char [] foo = "bar";'
> 
> With the error code:
> 
> 'foo.d(1): Error: cannot implicitly convert expression ("bar") of type
> invariant char[3] to char[]'.
> 
> The only difference between the versions is that DMD 2.002 and up say
> "char[3u]" in the error message instead of "char[3]". All literal
> strings fail with this error message. The latest DMD 1.0 works fine,
> but I need traits.
> 

I can't seem to find the thread but This came up a few days ago in one of 
the NGs. I think the basic issue is that with the new const stuff an implicit 
case was removed. replace char[] with string and that error should go away.





More information about the Digitalmars-d mailing list