Fix cyclic references in GDScript 2.0

This commit is contained in:
Adam Scott
2022-10-09 12:41:28 -04:00
parent e8f9cd8ac5
commit 5704055d30
20 changed files with 626 additions and 113 deletions
@@ -1,7 +1,4 @@
const A := 42
func test():
pass
func something():
return "OK"
@@ -1,4 +1,4 @@
const Constants = preload("gdscript_to_preload.gd")
const Constants = preload("gdscript_to_preload.notest.gd")
func test():
var a := Constants.A
@@ -0,0 +1,4 @@
const A = preload("preload_cyclic_reference_a.notest.gd")
func test():
A.test_cyclic_reference()
@@ -0,0 +1,12 @@
const B = preload("preload_cyclic_reference_b.notest.gd")
const WAITING_FOR = "godot"
static func test_cyclic_reference():
B.test_cyclic_reference()
static func test_cyclic_reference_2():
B.test_cyclic_reference_2()
static func test_cyclic_reference_3():
B.test_cyclic_reference_3()
@@ -0,0 +1,10 @@
const A = preload("preload_cyclic_reference_a.notest.gd")
static func test_cyclic_reference():
A.test_cyclic_reference_2()
static func test_cyclic_reference_2():
A.test_cyclic_reference_3()
static func test_cyclic_reference_3():
print(A.WAITING_FOR)
@@ -1,4 +1,4 @@
const preloaded : GDScript = preload("gdscript_to_preload.gd")
const preloaded : GDScript = preload("gdscript_to_preload.notest.gd")
func test():
var preloaded_instance: preloaded = preloaded.new()