Fix type adjustment skipped when value is considered both not hard and not variant
This commit is contained in:
@ -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))
|
||||
@ -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
|
||||
Reference in New Issue
Block a user