February 13, 2012 [Issue 7492] New: [CTFE] Error at assign to immutable character array | ||||
---|---|---|---|---|
| ||||
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 --- Comment #0 from Denis <verylonglogin.reg@gmail.com> 2012-02-13 14:55:15 MSK --- --- 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: ------- |
February 23, 2012 [Issue 7492] [CTFE] Error at assign to immutable character array | ||||
---|---|---|---|---|
| ||||
Posted in reply to Denis | http://d.puremagic.com/issues/show_bug.cgi?id=7492 Don <clugdbug@yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clugdbug@yahoo.com.au --- Comment #1 from Don <clugdbug@yahoo.com.au> 2012-02-23 02:06:22 PST --- 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: ------- |
Copyright © 1999-2021 by the D Language Foundation