[Issue 6553] Better const(char[]) !-> string error message
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Dec 27 18:50:15 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6553
--- Comment #2 from Kenji Hara <k.hara.pg at gmail.com> 2012-12-27 18:50:09 PST ---
(In reply to comment #1)
> All of these compile in 2.061. Got any other test-cases or should we close?
Wait, the conversion in foo5 should fail correctly. If it is allowed, following
code will accidentally break const-correctness.
void main() {
char[] buf = ['a'];
immutable str = foo5(buf);
assert(str[0] == 'a');
buf[0] = 'b';
assert(str[0] == 'a'); // fails!?
}
And this code compiles without errors in current git head.
I think this is a regression. Will open a new issue.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list