]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Report internal error for invalid type parameter comparison
authorJürg Billeter <j@bitron.ch>
Fri, 15 Jul 2016 03:16:46 +0000 (05:16 +0200)
committerJürg Billeter <j@bitron.ch>
Fri, 15 Jul 2016 03:28:25 +0000 (05:28 +0200)
vala/valatypeparameter.vala

index f875f304dfd9799aa3e3bf6efc8383b73733aad1..0fa3bd8ed37cf4397b4586501852538ad93374a6 100644 (file)
@@ -49,6 +49,12 @@ public class Vala.TypeParameter : Symbol {
         *              otherwise
         */
        public bool equals (TypeParameter param2) {
-               return name == param2.name && parent_symbol == param2.parent_symbol;
+               /* only type parameters with the same parent are comparable */
+               if (parent_symbol != param2.parent_symbol) {
+                       Report.error (source_reference, "internal error: comparing type parameters with different parents");
+                       return false;
+               }
+
+               return name == param2.name;
        }
 }