--- Comment #1 from 2010-03-10 10:08:04 PST ---
This was the original code by Michel Fortin:

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

Norbert Nemec comments:
>I would say the possibility of a bug makes this code unsafe by definition. Ref 
>returns must be considered unsafe by default, unless the compiler can know for 
>sure that the object will exist beyond the lifetime of the function.<

So I think Norbert Nemec idea is: while the normal compiler error messages
assume correctness and need a demonstration of unsafety to be shown, @safe can
do the opposite assuming unsafety and requiring a demonstration of safety.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to