1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Merge pull request #73544 from mashumafi/fix-func-arg-null

Fix: Func with typed args error when arg is null
This commit is contained in:
Rémi Verschelde
2023-02-20 15:41:40 +01:00
3 changed files with 36 additions and 4 deletions

View File

@@ -0,0 +1,27 @@
# https://github.com/godotengine/godot/issues/72967
class CustomNode:
extends Node
static func test_custom_node(n: CustomNode):
if not n:
print("null node")
func test():
test_typed_argument_is_null()
func get_custom_node() -> CustomNode:
return null
func test_typed_argument_is_null():
var node: Node = Node.new()
print_node_name(node.get_parent())
node.free()
test_custom_node()
func test_custom_node():
CustomNode.test_custom_node(get_custom_node())
func print_node_name(n: Node):
if not n:
print("null node")

View File

@@ -0,0 +1,3 @@
GDTEST_OK
null node
null node