Re: [Vala] 'out' directive works improperly



On Tue, 2011-04-05 at 14:14 +0800, Xu Ming wrote:
Parameters passed to method by 'out' should be assigned inside the
callee before it returns. But this compiles successfully:


void method(ref int a,out int b)
{
      a++;
}


Furthermore, the compiler will accept something like this:
void method(ref int a,out int b)
{
    a = b;  // b not initialized yet!
    a++;
}

Perhaps vala is putting some default value for out parameters.

Nice day
Nor Jaidi Tuah





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]