[vala/staging] vala: Improve parameter check of "get" method meant to be used by foreach (2)



commit 0be560d8380a6e9a8b9d307ede109412cbdc55bd
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Fri Jun 26 09:40:11 2020 +0200

    vala: Improve parameter check of "get" method meant to be used by foreach (2)
    
    Actually all integer-types as index parameter.

 vala/valaforeachstatement.vala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/vala/valaforeachstatement.vala b/vala/valaforeachstatement.vala
index c7fb6ee50..383814085 100644
--- a/vala/valaforeachstatement.vala
+++ b/vala/valaforeachstatement.vala
@@ -197,7 +197,7 @@ public class Vala.ForeachStatement : Block {
                        return false;
                }
                unowned List<Parameter> parameters = get_method.get_parameters ();
-               if (parameters.size != 1 || !parameters[0].variable_type.compatible 
(context.analyzer.int_type)) {
+               if (parameters.size != 1 || !(parameters[0].variable_type is IntegerType)) {
                        return false;
                }
                var size_property = collection_type.get_member ("size") as Property;


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