[Issue 24394] mutable array can be returned as string
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Wed Feb 14 11:49:53 UTC 2024
    
    
  
https://issues.dlang.org/show_bug.cgi?id=24394
--- Comment #2 from Forest <forestix at nom.one> ---
The above example does indeed trigger an error with -preview=fixImmutableConv
on run.dlang.org. However, changing the test function's argument to
const(ubyte)[] slips right past with no complaint.
Shouldn't that be rejected as well?
string test(const(ubyte)[] arr)
{
    import std.string;
    return arr.assumeUTF; // why does this compile?
}
--
    
    
More information about the Digitalmars-d-bugs
mailing list