diff options
author | George Marques <george@gmarqu.es> | 2021-09-17 11:52:30 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2021-09-17 11:52:30 -0300 |
commit | 4e69341c016c5182c41a563829cae3d619af9bdd (patch) | |
tree | 6dfa7f6c01040942a5cd83530177a5763c735273 /modules/gdscript/tests/scripts/analyzer/features | |
parent | f701d9b0f784e136106233fd87900dc4775bc7e8 (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.gd | 9 | ||||
-rw-r--r-- | modules/gdscript/tests/scripts/analyzer/features/auto_inferred_type_dont_error.out | 2 |
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 |