January 30, 2012 [Issue 4539] Refuse assignment to string literal | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4539 --- Comment #19 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-01-29 20:51:39 PST --- (In reply to comment #17) > void foo(immutable ref string) {} I'm curious, what does `immutable ref string` buy you compared to just immutable string? Can't the compiler pass by ref automatically if it's an immutable type? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 01, 2012 [Issue 4539] Refuse assignment to string literal | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4539 --- Comment #20 from bearophile_hugs@eml.cc 2012-01-31 17:09:46 PST --- (In reply to comment #18) > Yes, it is expected behavior. I have just seen that some of my code that used to compile now gives a problem. This is a reduced version: void foo(ref string t) {} void main() { immutable string s; foo(s); } DMD 2.058head gives: test.d(4): Error: function test.foo (ref string t) is not callable using argument types (immutable(char[])) Is this correct? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 01, 2012 [Issue 4539] Refuse assignment to string literal | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4539 --- Comment #21 from bearophile_hugs@eml.cc 2012-01-31 17:24:32 PST --- (In reply to comment #20) > Is this correct? Yes, it's correct, sorry. -- 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