You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-04 17:04:49 +00:00
Merge pull request #70733 from vonagam/fix-assigning-untyped
GDScript: Fix some issues with assignments that involve untyped things
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
func test():
|
||||
var foo: bool = true
|
||||
foo += 'bar'
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Invalid operands "bool" and "String" for assignment operator.
|
||||
@@ -0,0 +1,19 @@
|
||||
func test():
|
||||
var one_0 = 0
|
||||
one_0 = 1
|
||||
var one_1 := one_0
|
||||
print(one_1)
|
||||
|
||||
var two: Variant = 0
|
||||
two += 2
|
||||
print(two)
|
||||
|
||||
var three_0: Variant = 1
|
||||
var three_1: int = 2
|
||||
three_0 += three_1
|
||||
print(three_0)
|
||||
|
||||
var four_0: int = 3
|
||||
var four_1: Variant = 1
|
||||
four_0 += four_1
|
||||
print(four_0)
|
||||
@@ -0,0 +1,5 @@
|
||||
GDTEST_OK
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
Reference in New Issue
Block a user