GVala added.

This commit is contained in:
Kolan Sh 2012-10-12 19:58:09 +04:00
parent ee0be23c95
commit 881a974b3e
1 changed files with 36 additions and 0 deletions

36
vala/gvala/gvala.vala Normal file
View File

@ -0,0 +1,36 @@
class AAA : GLib.Object {
public int vala;
public virtual AAA clone () {
var a = new AAA();
a.vala = this.vala;
return a;
}
}
class subAAA : AAA {
public int sub_vala;
public virtual new subAAA clone () {
var a = new subAAA();
a.sub_vala = this.sub_vala;
return a;
}
}
class GVala : GLib.Object {
public static int main (string[] args) {
var suba = new subAAA();
suba.vala = 1;
suba.sub_vala = 2;
var subb = suba.clone();
stdout.printf ("{%d;%d}\n", suba.vala, suba.sub_vala);
stdout.printf ("{%d;%d}\n", subb.vala, subb.sub_vala);
return 0;
}
}