]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Add abi-stability path for interfaces aa2803c7c48ab32400b594a108d78c2330cd4e76
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 18 Jan 2018 12:06:39 +0000 (13:06 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 20 Jan 2018 16:34:41 +0000 (17:34 +0100)
Based on patch by Daniel Espinosa

https://bugzilla.gnome.org/show_bug.cgi?id=789069

vala/valainterface.vala

index 8e3229c9450c94245ecd048269711dbb81c29eab..72d345476b508ec60681bc47b139fc07e9aeabff 100644 (file)
@@ -261,13 +261,6 @@ public class Vala.Interface : ObjectTypeSymbol {
                        en.check (context);
                }
 
-               foreach (Method m in get_methods ()) {
-                       m.check (context);
-                       if (m.is_virtual || m.is_abstract) {
-                               virtuals.add (m);
-                       }
-               }
-
                foreach (Field f in get_fields ()) {
                        f.check (context);
                }
@@ -276,17 +269,48 @@ public class Vala.Interface : ObjectTypeSymbol {
                        c.check (context);
                }
 
-               foreach (Signal sig in get_signals ()) {
-                       sig.check (context);
-                       if (sig.is_virtual) {
-                               virtuals.add (sig);
+               if (context.abi_stability) {
+                       foreach (Symbol s in get_members ()) {
+                               if (s is Method) {
+                                       var m = (Method) s;
+                                       m.check (context);
+                                       if (m.is_virtual || m.is_abstract) {
+                                               virtuals.add (m);
+                                       }
+                               } else if (s is Signal) {
+                                       var sig = (Signal) s;
+                                       sig.check (context);
+                                       if (sig.is_virtual) {
+                                               virtuals.add (sig);
+                                       }
+                               } else if (s is Property) {
+                                       var prop = (Property) s;
+                                       prop.check (context);
+                                       if (prop.is_virtual || prop.is_abstract) {
+                                               virtuals.add (prop);
+                                       }
+                               }
+                       }
+               } else {
+                       foreach (Method m in get_methods ()) {
+                               m.check (context);
+                               if (m.is_virtual || m.is_abstract) {
+                                       virtuals.add (m);
+                               }
                        }
-               }
 
-               foreach (Property prop in get_properties ()) {
-                       prop.check (context);
-                       if (prop.is_virtual || prop.is_abstract) {
-                               virtuals.add (prop);
+                       foreach (Signal sig in get_signals ()) {
+                               sig.check (context);
+                               if (sig.is_virtual) {
+                                       virtuals.add (sig);
+                               }
+                       }
+
+                       foreach (Property prop in get_properties ()) {
+                               prop.check (context);
+                               if (prop.is_virtual || prop.is_abstract) {
+                                       virtuals.add (prop);
+                               }
                        }
                }