GVala added.

This commit is contained in:
Kolan Sh 2012-10-12 20:04:37 +04:00
parent 881a974b3e
commit 8b1fea5f14
1 changed files with 6 additions and 9 deletions

View File

@ -1,21 +1,17 @@
class AAA : GLib.Object {
public int vala;
public virtual AAA clone () {
var a = new AAA();
public virtual void copy (AAA a) {
a.vala = this.vala;
return a;
}
}
class subAAA : AAA {
public int sub_vala;
public virtual new subAAA clone () {
var a = new subAAA();
public virtual new void copy (subAAA a) {
((AAA)this).copy(a);
a.sub_vala = this.sub_vala;
return a;
}
}
@ -25,7 +21,8 @@ class GVala : GLib.Object {
suba.vala = 1;
suba.sub_vala = 2;
var subb = suba.clone();
var subb = new subAAA();
suba.copy (subb);
stdout.printf ("{%d;%d}\n", suba.vala, suba.sub_vala);