You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (argument->reduced_value.get_type() != Variant::INT && argument->reduced_value.get_type() != Variant::FLOAT) {
2224
-
can_reduce = false;
2225
-
push_error(vformat(R"*(Invalid argument for "range()" call. Argument %d should be int or float but "%s" was given.)*", i + 1, Variant::get_type_name(argument->reduced_value.get_type())), argument);
push_error(vformat(R"*(Invalid argument for "range()" call. Argument %d should be int or float but "%s" was given.)*", i + 1, argument_type.to_string()), argument);
2241
-
}
2242
-
}
2243
-
}
2244
-
}
2198
+
GDScriptParser::DataType variable_type;
2199
+
GDScriptParser::DataType list_type;
2245
2200
2246
-
Variant reduced;
2201
+
if (p_for->list) {
2202
+
resolve_node(p_for->list, false);
2247
2203
2248
-
if (can_reduce) {
2249
-
switch (args.size()) {
2250
-
case1:
2251
-
reduced = (int32_t)args[0];
2252
-
break;
2253
-
case2:
2254
-
reduced = Vector2i(args[0], args[1]);
2255
-
break;
2256
-
case3:
2257
-
reduced = Vector3i(args[0], args[1], args[2]);
2258
-
break;
2259
-
}
2260
-
p_for->list->is_constant = true;
2261
-
p_for->list->reduced_value = reduced;
2204
+
bool is_range = false;
2205
+
if (p_for->list->type == GDScriptParser::Node::CALL) {
push_error(vformat(R"(Unable to iterate on value of type "%s" with variable of type "%s".)", list_visible_type, specified_type.to_string()), p_for->datatype_specifier);
2283
+
push_error(vformat(R"(Unable to iterate on value of type "%s" with variable of type "%s".)", list_type.to_string(), specified_type.to_string()), p_for->datatype_specifier);
0 commit comments