summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests/scripts/analyzer/features
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2021-09-17 11:52:30 -0300
committerGeorge Marques <george@gmarqu.es>2021-09-17 11:52:30 -0300
commit4e69341c016c5182c41a563829cae3d619af9bdd (patch)
tree6dfa7f6c01040942a5cd83530177a5763c735273 /modules/gdscript/tests/scripts/analyzer/features
parentf701d9b0f784e136106233fd87900dc4775bc7e8 (diff)
GDScript: Avoid inferred types from giving hard errors
Diffstat (limited to 'modules/gdscript/tests/scripts/analyzer/features')
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/auto_inferred_type_dont_error.gd9
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/auto_inferred_type_dont_error.out2
2 files changed, 11 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/features/auto_inferred_type_dont_error.gd b/modules/gdscript/tests/scripts/analyzer/features/auto_inferred_type_dont_error.gd
new file mode 100644
index 0000000000..f64dce26c9
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/auto_inferred_type_dont_error.gd
@@ -0,0 +1,9 @@
+func inferred_parameter(param = null):
+ if param == null:
+ param = Node.new()
+ param.name = "Ok"
+ print(param.name)
+ param.free()
+
+func test():
+ inferred_parameter()
diff --git a/modules/gdscript/tests/scripts/analyzer/features/auto_inferred_type_dont_error.out b/modules/gdscript/tests/scripts/analyzer/features/auto_inferred_type_dont_error.out
new file mode 100644
index 0000000000..0e9f482af4
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/auto_inferred_type_dont_error.out
@@ -0,0 +1,2 @@
+GDTEST_OK
+Ok