Merge pull request #62688 from cdemirer/assignments-and-types

Fixes https://github.com/godotengine/godot/issues/62650
This commit is contained in:
George Marques
2022-12-30 16:38:35 -03:00
committed by GitHub
3 changed files with 31 additions and 14 deletions

View File

@ -0,0 +1,9 @@
func test():
var x: int = 2
var y = 3.14
var z := 2.72
print(typeof(x))
x = y
print(typeof(x))
x = z
print(typeof(x))

View File

@ -0,0 +1,12 @@
GDTEST_OK
>> WARNING
>> Line: 6
>> NARROWING_CONVERSION
>> Narrowing conversion (float is converted to int and loses precision).
>> WARNING
>> Line: 8
>> NARROWING_CONVERSION
>> Narrowing conversion (float is converted to int and loses precision).
2
2
2