[vala/0.34] Do not report internal error for invalid code with nested generics



commit de387fefcd34e1f8e083c6a646f1ca27f679bf11
Author: Jürg Billeter <j bitron ch>
Date:   Thu Oct 6 11:07:59 2016 +0200

    Do not report internal error for invalid code with nested generics
    
    Reported-by: Matthias Berndt <matthias_berndt gmx de>

 vala/valatypeparameter.vala |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/vala/valatypeparameter.vala b/vala/valatypeparameter.vala
index 0fa3bd8..de0023b 100644
--- a/vala/valatypeparameter.vala
+++ b/vala/valatypeparameter.vala
@@ -49,12 +49,12 @@ public class Vala.TypeParameter : Symbol {
         *              otherwise
         */
        public bool equals (TypeParameter param2) {
-               /* 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");
+               /* only type parameters with a common scope are comparable */
+               if (!owner.is_subscope_of (param2.owner) && !param2.owner.is_subscope_of (owner)) {
+                       Report.error (source_reference, "internal error: comparing type parameters from 
different scopes");
                        return false;
                }
 
-               return name == param2.name;
+               return name == param2.name && parent_symbol == param2.parent_symbol;
        }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]