]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Do not report inherited interface implementations as unused
authorJürg Billeter <j@bitron.ch>
Tue, 15 Sep 2009 10:02:31 +0000 (12:02 +0200)
committerJürg Billeter <j@bitron.ch>
Tue, 15 Sep 2009 10:02:31 +0000 (12:02 +0200)
vala/valaclass.vala

index f88efabaae2b30500c7205df4a6e9db6a8392841..dad8b8aaf6dd54c0cb2a07ac93a09a956fd29e7f 100644 (file)
@@ -1092,7 +1092,10 @@ public class Vala.Class : ObjectTypeSymbol {
                                                                sym = base_class.scope.lookup (m.name);
                                                                base_class = base_class.base_class;
                                                        }
-                                                       if (!(sym is Method)) {
+                                                       if (sym is Method) {
+                                                               // method is used as interface implementation, so it is not unused
+                                                               sym.used = true;
+                                                       } else {
                                                                error = true;
                                                                Report.error (source_reference, "`%s' does not implement interface method `%s'".printf (get_full_name (), m.get_full_name ()));
                                                        }
@@ -1108,7 +1111,10 @@ public class Vala.Class : ObjectTypeSymbol {
                                                                sym = base_class.scope.lookup (prop.name);
                                                                base_class = base_class.base_class;
                                                        }
-                                                       if (!(sym is Property)) {
+                                                       if (sym is Property) {
+                                                               // property is used as interface implementation, so it is not unused
+                                                               sym.used = true;
+                                                       } else {
                                                                error = true;
                                                                Report.error (source_reference, "`%s' does not implement interface property `%s'".printf (get_full_name (), prop.get_full_name ()));
                                                        }