1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

GDScript: Don't coerce default values to the export hint type

This behavior is inconsistent with non tools builds and can create
issues. Instead, a warning is emitted if there's a type mismatch. If the
type can't be converted, an error is shown instead.

For the editor it gives a converted value to avoid issues with the
property editor, which expects the correct type.
This commit is contained in:
George Marques
2022-03-02 10:55:46 -03:00
parent a76316c0f0
commit f2166ba92f
4 changed files with 28 additions and 7 deletions

View File

@@ -304,6 +304,7 @@ struct GDScriptWarning {
UNSAFE_CALL_ARGUMENT, // Function call argument is of a supertype of the require argument
DEPRECATED_KEYWORD, // The keyword is deprecated and should be replaced
STANDALONE_TERNARY, // Return value of ternary expression is discarded
EXPORT_HINT_TYPE_MISTMATCH, // The type of the variable's default value doesn't match its export hint
WARNING_MAX,
} code;
Vector<String> symbols;