On Monday, 6 October 2014 at 11:28:16 UTC, John Colvin wrote:
string a;
char[] b;
pragma(msg, typeof(a ~ b)); // char[]

why not string?

What are the rules that determine this?

*Ideally*, I'd have said "it returns char[], so that you can chose via purity".

However, it's not pure, so that argument doesn't hold.

That said, casting to immutable is safe provided you never actually mutate. The reverse isn't true.

To answer the question directly though, I don't know what the rules are. I'd guess they are mostly "whatever druntime implemented" though...

Reply via email to