1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Prevent non explicit inferring parameter from null

This commit is contained in:
jmb462
2021-09-11 21:05:44 +02:00
parent 9d629fa7fb
commit b9219bedf7

View File

@@ -1478,6 +1478,10 @@ void GDScriptAnalyzer::resolve_parameter(GDScriptParser::ParameterNode *p_parame
}
}
if (result.builtin_type == Variant::Type::NIL && result.type_source == GDScriptParser::DataType::ANNOTATED_INFERRED && p_parameter->datatype_specifier == nullptr) {
push_error(vformat(R"(Could not infer the type of the variable "%s" because the initial value is "null".)", p_parameter->identifier->name), p_parameter->default_value);
}
p_parameter->set_datatype(result);
}