GDScript: Consolidate behavior for assigning enum types

This makes sure that assigning values to enum-typed variables are
consistent. Same enum is always valid, different enum is always
invalid (without casting) and assigning `int` creates a warning
if there is no casting.

There are new test cases to ensure this behavior doesn't break in
the future.
This commit is contained in:
George Marques committed 2022-02-03 13:32:16 -03:00
1 parent 82efb1d262
commit ad6e2e82a9
27 files changed
+185 -29

No files matched your search

-2
View File
@@ -3737,8 +3737,6 @@ String GDScriptParser::DataType::to_string() const {
}
case ENUM:
return enum_type.operator String() + " (enum)";
case ENUM_VALUE:
return enum_type.operator String() + " (enum value)";
case UNRESOLVED:
return "<unresolved type>";
}