www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7492] New: [CTFE] Error at assign to immutable character array

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7492

           Summary: [CTFE] Error at assign to immutable character array
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com



---
---
auto f() { return new char[1];  }

immutable s = f(); // error, works with non-character arrays
---
Error: cannot implicitly convert expression ("\xff") of type char[] to
immutable(char[])

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 13 2012
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7492


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au



I'm not sure about this. The int[] case may be an accepts-invalid bug.

If you move the declaration of 's' into the inside of a function, you get the
same error message, even though CTFE is not involved. And when you do that, if
it's an int[] instead of char[], you get the same error.

In any case the error is not generated by CTFE.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 23 2012