-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90134 from AThousandShips/construct_fix
[Core] Fix `Variant::construct` of `Object`
- Loading branch information
Showing
5 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
modules/gdscript/tests/scripts/runtime/errors/invalid_property_assignment.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# https://github.com/godotengine/godot/issues/90086 | ||
|
||
class MyObj: | ||
var obj: WeakRef | ||
|
||
func test(): | ||
var obj_1 = MyObj.new() | ||
var obj_2 = MyObj.new() | ||
obj_1.obj = obj_2 |
6 changes: 6 additions & 0 deletions
6
modules/gdscript/tests/scripts/runtime/errors/invalid_property_assignment.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
GDTEST_RUNTIME_ERROR | ||
>> SCRIPT ERROR | ||
>> on function: test() | ||
>> runtime/errors/invalid_property_assignment.gd | ||
>> 9 | ||
>> Invalid assignment of property or key 'obj' with value of type 'RefCounted (MyObj)' on a base object of type 'RefCounted (MyObj)'. |
11 changes: 11 additions & 0 deletions
11
modules/gdscript/tests/scripts/runtime/features/set_does_not_leak.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# https://github.com/godotengine/godot/issues/90086 | ||
|
||
class MyObj: | ||
var obj : WeakRef | ||
|
||
func test(): | ||
var obj_1 = MyObj.new() | ||
var obj_2 = MyObj.new() | ||
assert(obj_2.get_reference_count() == 1) | ||
obj_1.set(&"obj", obj_2) | ||
assert(obj_2.get_reference_count() == 1) |
1 change: 1 addition & 0 deletions
1
modules/gdscript/tests/scripts/runtime/features/set_does_not_leak.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
GDTEST_OK |