summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests/scripts/analyzer/features
diff options
context:
space:
mode:
authorocean (they/them) <anvilfolk@gmail.com>2023-02-15 16:00:22 -0500
committerocean (they/them) <anvilfolk@gmail.com>2023-02-15 17:54:38 -0500
commit94dfac8da7bf8230f292cad8839696f572e8357c (patch)
tree5af243adf75933aa9acbfc620c91a139ab4401a4 /modules/gdscript/tests/scripts/analyzer/features
parentf2aae8fa5c2e9d9323832fb43c8446c2e518d698 (diff)
Add return type for GDScript getters
Diffstat (limited to 'modules/gdscript/tests/scripts/analyzer/features')
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/getter_return_type.gd9
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/getter_return_type.out2
2 files changed, 11 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.gd b/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.gd
new file mode 100644
index 0000000000..38bb7f6e9c
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.gd
@@ -0,0 +1,9 @@
+var Value:int = 8 :
+ get:
+ return Value
+ set(v):
+ Value = v
+
+func test():
+ var f:float = Value
+ print(int(f))
diff --git a/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.out b/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.out
new file mode 100644
index 0000000000..b0cb63ef59
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.out
@@ -0,0 +1,2 @@
+GDTEST_OK
+8