Implicit conversion of concatenation result to immutable

Per Nordlöw per.nordlow at gmail.com
Fri Apr 2 00:02:18 UTC 2021


On Thursday, 1 April 2021 at 23:21:56 UTC, Ali Çehreli wrote:
> As I mentioned elsewhere in this thread, the element type must 
> not have indirections though. If S is a struct with 
> indirections, concatenating const(S)[] should still produce 
> const(S)[].

Thanks.

Got something working that allows the implicit conversion at

https://github.com/dlang/dmd/pull/12341

for the sample code

```d
@safe pure unittest
{
     const(char)[] x;
     string y;
     string z1 = x ~ y; // now passes
     string z2 = y ~ x; // now passes
}
```

but nothing else.

Feel perfectly free to fill in the details or even take over the 
PR.


More information about the Digitalmars-d mailing list