From: Rico Tzschichholz Date: Fri, 26 Jun 2020 07:40:11 +0000 (+0200) Subject: vala: Improve parameter check of "get" method meant to be used by foreach (2) X-Git-Tag: 0.49.1~83 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fkeep-around%2F0be560d8380a6e9a8b9d307ede109412cbdc55bd;p=thirdparty%2Fvala.git vala: Improve parameter check of "get" method meant to be used by foreach (2) Actually all integer-types as index parameter. --- 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 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;