Fix type adjustment skipped when value is considered both not hard and not variant

This commit is contained in:
cdemirer
2022-07-04 01:10:16 +03:00
parent f382a2b59b
commit bbb21c3fd5
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