[Vala] 'out' directive works improperly



Parameters passed to method by 'out' should be assigned inside the
callee before it returns. But this compiles successfully:

public static int main(string[] args)
{
        int kk=9,jj;
        method(ref kk,out jj);
        stdout.printf("%d %d\n",kk,jj);
        return 0;
}

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

it prints:
10 0

I'm using v0.12.0




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