2022-12-05 19:24:11 +01:00
|
|
|
# https://github.com/godotengine/godot/pull/69620
|
|
|
|
|
|
|
|
var a: int = 1
|
|
|
|
|
|
|
|
func shadow_regular_assignment(a: Variant, b: Variant) -> void:
|
2022-12-26 17:24:17 +01:00
|
|
|
print(a)
|
|
|
|
print(self.a)
|
|
|
|
a = b
|
|
|
|
print(a)
|
|
|
|
print(self.a)
|
2022-12-05 19:24:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
var v := Vector2(0.0, 0.0)
|
|
|
|
|
|
|
|
func shadow_subscript_assignment(v: Vector2, x: float) -> void:
|
2022-12-26 17:24:17 +01:00
|
|
|
print(v)
|
|
|
|
print(self.v)
|
|
|
|
v.x += x
|
|
|
|
print(v)
|
|
|
|
print(self.v)
|
2022-12-05 19:24:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
func test():
|
2022-12-26 17:24:17 +01:00
|
|
|
shadow_regular_assignment('a', 'b')
|
|
|
|
shadow_subscript_assignment(Vector2(1.0, 1.0), 5.0)
|