1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-22 15:06:45 +00:00

Fix incomplete shadowing of member properties by parameters

This commit is contained in:
Dmitrii Maganov
2022-12-05 20:24:11 +02:00
parent f3e6750a7e
commit 97280279ee
4 changed files with 50 additions and 3 deletions

View File

@@ -0,0 +1,25 @@
# https://github.com/godotengine/godot/pull/69620
var a: int = 1
func shadow_regular_assignment(a: Variant, b: Variant) -> void:
print(a)
print(self.a)
a = b
print(a)
print(self.a)
var v := Vector2(0.0, 0.0)
func shadow_subscript_assignment(v: Vector2, x: float) -> void:
print(v)
print(self.v)
v.x += x
print(v)
print(self.v)
func test():
shadow_regular_assignment('a', 'b')
shadow_subscript_assignment(Vector2(1.0, 1.0), 5.0)