[Vala] 'out' directive works improperly
- From: Xu Ming <xm xming gmail com>
- To: vala-list gnome org
- Subject: [Vala] 'out' directive works improperly
- Date: Tue, 05 Apr 2011 14:14:18 +0800
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]