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

@@ -321,6 +321,9 @@
<member name="debug/gdscript/warnings/exclude_addons" type="bool" setter="" getter="" default="true">
If [code]true[/code], scripts in the [code]res://addons[/code] folder will not generate warnings.
</member>
<member name="debug/gdscript/warnings/export_hint_type_mistmatch" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when the type of the default value set to an exported variable is different than the specified export type.
</member>
<member name="debug/gdscript/warnings/function_conflicts_constant" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when a function is declared with the same name as a constant.
</member>