diff options
author | ZuBsPaCe <kurt.rudin@gmx.net> | 2021-09-06 07:04:43 +0200 |
---|---|---|
committer | ZuBsPaCe <kurt.rudin@gmx.net> | 2021-10-08 22:06:15 +0200 |
commit | 551ceb590bef2a521341fe9006a97a0138578f05 (patch) | |
tree | 6e36d1db771720170c2d2f66cba226f5f3541b19 /modules/gdscript/tests/scripts/analyzer/features/property_functions.gd | |
parent | 58aa020a19162becc9a00fed8a240eb12b0ab964 (diff) |
GDScript: Report property type errors
Inline getters & setters are now FunctionNodes.
Their names are set in the parser, not in the compiler.
GDScript-Analyzer will now run through getter and setter.
Also report wrong type or signature errors regarding getset properties.
Added GDScript tests for getters and setters.
#53102
Diffstat (limited to 'modules/gdscript/tests/scripts/analyzer/features/property_functions.gd')
-rw-r--r-- | modules/gdscript/tests/scripts/analyzer/features/property_functions.gd | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/features/property_functions.gd b/modules/gdscript/tests/scripts/analyzer/features/property_functions.gd new file mode 100644 index 0000000000..1706087f82 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/features/property_functions.gd @@ -0,0 +1,16 @@ +var _prop = 1 +var prop: + get = get_prop, set = set_prop + +func get_prop(): + return _prop + +func set_prop(value): + _prop = value + +func test(): + print(prop) + + prop = 2 + + print(prop) |