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

View file

@ -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

View file

@ -0,0 +1,4 @@
const A = preload("preload_cyclic_reference_a.notest.gd")
func test():
A.test_cyclic_reference()

View file

@ -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()

View file

@ -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)

View file

@ -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()