]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
WIP wip/gtk-constraints
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 3 Aug 2023 15:17:23 +0000 (17:17 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 31 Jan 2024 17:51:29 +0000 (18:51 +0100)
tests/generics/no-generic-args-compact-class.vala

index 95a97b483707462c8807df1dfb67515948b64b7c..b932d504f36f7117ffb99440968773abd4f7fd0f 100644 (file)
@@ -1,25 +1,22 @@
-
-void main () {
-       var b = new Baz<Bar> ();
-       unowned Bar z = b.test ();
-}
-
 [Compact]
 class Foo {
-       public int l;
+       public int i;
 }
 
 [Compact]
 class Bar : Foo {
-       public void t () {
-       }
 }
 
-[CCode (no_generic_args=true)]
-class Baz<J> : Object where J : Foo {
-       J x;
+[CCode (no_generic_args = true)]
+class Baz<G> : Object where G : Foo {
+       G g;
 
-       public unowned J test () {
-               return this.x;
+       public unowned G foo () {
+               return g;
        }
 }
+
+void main () {
+       var baz = new Baz<Bar> ();
+       unowned Bar bar = baz.foo ();
+}