1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-05 19:31:35 +00:00

Fix crash with non-constant keys in match statement Dictionary pattern

This commit is contained in:
cdemirer
2022-01-26 04:10:07 +08:00
parent d9fd16c8e4
commit 28ac4d8b7d

View File

@@ -1586,7 +1586,7 @@ void GDScriptAnalyzer::resolve_match_pattern(GDScriptParser::PatternNode *p_matc
if (p_match_pattern->dictionary[i].key) {
reduce_expression(p_match_pattern->dictionary[i].key);
if (!p_match_pattern->dictionary[i].key->is_constant) {
push_error(R"(Expression in dictionary pattern key must be a constant.)", p_match_pattern->expression);
push_error(R"(Expression in dictionary pattern key must be a constant.)", p_match_pattern->dictionary[i].key);
}
}