Is return by ref really @safe?

bearophile bearophileHUGS at lycos.com
Wed Mar 10 07:43:53 PST 2010


Michel Fortin:
> This compiles, but should it?

I think the @safe attribute is not significant here, because that code is wrong, in unsafe code too.
I think DMD lets it pass because it's not able to spot the bug. I don't know if and when it will be able to trace such situations, but in the meantime:
http://d.puremagic.com/issues/show_bug.cgi?id=3925

Bye,
bearophile



More information about the Digitalmars-d mailing list