]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
method: Always consider compatible with itself
authorMarvin W <git@larma.de>
Mon, 20 Mar 2017 17:50:06 +0000 (18:50 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 20 Mar 2017 19:49:06 +0000 (20:49 +0100)
This is even the case with unresolved types.

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

vala/valamethod.vala

index f79ec7b5ed3adccf03790d4cc9d6533b0c97a81c..8789468903558001315f25e11b1b5003b3a0077e 100644 (file)
@@ -307,6 +307,12 @@ public class Vala.Method : Subroutine, Callable {
         * @return true if the specified method is compatible to this method
         */
        public bool compatible (Method base_method, out string? invalid_match) {
+               // method is always compatible to itself
+               if (this == base_method) {
+                       invalid_match = null;
+                       return true;
+               }
+
                if (binding != base_method.binding) {
                        invalid_match = "incompatible binding";
                        return false;