-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
In Godot 4.6 (and probably before, since the warning as error was introduced earlier), there is a warning treated as error by default on that line res://ldtk-importer/src/util/util.gd:24:
var data := JSON.parse_string(json.get_as_text())
This causes warning as error:
ERROR: res://ldtk-importer/src/util/util.gd:24 - Parse Error: The variable type is being inferred from a Variant value, so it will be typed as Variant. (Warning treated as error.)
which in turns triggers a chain of errors (but not relevant to us):
ERROR: res://ldtk-importer/src/util/definition_util.gd:0 - Compile Error: Failed to compile depended scripts.
ERROR: modules/gdscript/gdscript.cpp:2907 - Failed to load script "res://ldtk-importer/src/util/definition_util.gd" with error "Compilation failed".
ERROR: Attempt to open script 'res://addons/ldtk-importer/src/components/ldtk-entity.gd' resulted in error 'File not found'.
ERROR: Failed loading resource: res://addons/ldtk-importer/src/components/ldtk-entity.gd.
I fixed it locally by removing statically inferred type:
# CHANGED: replaced `:=` with `=` to fix "Parse Error: The variable type is
# being inferred from a Variant value, so it will be typed as Variant.
# (Warning treated as error.)"
var data = JSON.parse_string(json.get_as_text())Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels