From 881a974b3ebaa6f373cad6f2bec47b521d5b7607 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Fri, 12 Oct 2012 19:58:09 +0400 Subject: [PATCH] GVala added. --- vala/gvala/gvala.vala | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 vala/gvala/gvala.vala diff --git a/vala/gvala/gvala.vala b/vala/gvala/gvala.vala new file mode 100644 index 0000000..b76e1d9 --- /dev/null +++ b/vala/gvala/gvala.vala @@ -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; + } +}