GVala added.

This commit is contained in:
Kolan Sh 2012-10-12 20:24:44 +04:00
parent 8b1fea5f14
commit 40334d814c
1 changed files with 10 additions and 20 deletions

View File

@ -1,32 +1,22 @@
class AAA : GLib.Object {
public int vala;
public virtual void copy (AAA a) {
a.vala = this.vala;
class Base : GLib.Object {
public virtual void copy () {
stdout.printf ("Base copy() called\n");
}
}
class subAAA : AAA {
public int sub_vala;
public virtual new void copy (subAAA a) {
((AAA)this).copy(a);
a.sub_vala = this.sub_vala;
class Sub : Base {
public override void copy () {
stdout.printf ("Sub copy() called\n");
}
}
class GVala : GLib.Object {
public static int main (string[] args) {
var suba = new subAAA();
suba.vala = 1;
suba.sub_vala = 2;
// var base = new Base();
// var sub = new Sub();
Base b = new Sub();
var subb = new subAAA();
suba.copy (subb);
stdout.printf ("{%d;%d}\n", suba.vala, suba.sub_vala);
stdout.printf ("{%d;%d}\n", subb.vala, subb.sub_vala);
b.copy();
return 0;
}