Implicit conversion of concatenation result to immutable

Steven Schveighoffer schveiguy at gmail.com
Thu Apr 1 21:41:06 UTC 2021


On 4/1/21 5:21 PM, Per Nordlöw wrote:

> Error: cannot implicitly convert expression `x ~ cast(const(char)[])y` 
> of type `char[]` to `string`

That makes no sense. The compiler should allow that conversion. It can 
clearly prove that the result doesn't derive from the parameters.

I'm surprised it doesn't return const(char)[].

-Steve


More information about the Digitalmars-d mailing list