Implicit conversion of unique chars[] to string

Per Nordlöw per.nordlow at gmail.com
Mon Mar 22 20:38:36 UTC 2021


Am I the only one being annoyed by the fact that

     chainPath(...).array

doesn't implicit convert to string despite the array returned 
from .array is allocated by the GC.

Yes, I know that I should do

     chainPath(...).array.assumeUnique

but the uniqueness of .array (and in turn implicit conversion to 
immutable) should be inferred by the compiler.

Inference could happen in the same compiler pass that checks 
(will infer) scope qualifiers.

Are there plans for making this happen?

Is having a @unique qualifier motivated for the sake of compiler 
performance to avoid the for need transitive inference across 
function calls?


More information about the Digitalmars-d-learn mailing list