GDScript: Make setter parameter type same as variable type

This commit is contained in:
George Marques
2021-10-12 09:39:23 -03:00
parent b67e68bce3
commit 45f546c1d8
3 changed files with 13 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
var with_setter := 0:
set(val):
var x: String = val
with_setter = val
func test():
with_setter = 1
print(with_setter)

View File

@@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Value of type "int" cannot be assigned to a variable of type "String".