This compiles, but should it?

@safe
ref int foo(ref int a) {
        return a;
}

@safe
ref int bar() {
        int a;
        return foo(a); // leaking reference to a beyond bar's scope
}

--
Michel Fortin
[email protected]
http://michelf.com/

Reply via email to