mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
GDScript: Allow out of order member resolution
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
The member "Vector2" cannot have the same name as a builtin type.
|
||||
Class "Vector2" hides a built-in type.
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
func test():
|
||||
print(InnerA.new())
|
||||
|
||||
class InnerA extends InnerB:
|
||||
pass
|
||||
|
||||
class InnerB extends InnerA:
|
||||
pass
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Cyclic inheritance.
|
||||
@@ -0,0 +1,5 @@
|
||||
func test():
|
||||
print(c1)
|
||||
|
||||
const c1 = c2
|
||||
const c2 = c1
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Could not resolve member "c1": Cyclic reference.
|
||||
@@ -0,0 +1,5 @@
|
||||
func test():
|
||||
print(E1.V)
|
||||
|
||||
enum E1 {V = E2.V}
|
||||
enum E2 {V = E1.V}
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Could not resolve member "E1": Cyclic reference.
|
||||
@@ -0,0 +1,5 @@
|
||||
func test():
|
||||
print(EV1)
|
||||
|
||||
enum {EV1 = EV2}
|
||||
enum {EV2 = EV1}
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Could not resolve member "EV1": Cyclic reference.
|
||||
@@ -0,0 +1,6 @@
|
||||
func test():
|
||||
print(v)
|
||||
|
||||
var v = A.v
|
||||
|
||||
const A = preload("cyclic_ref_external_a.notest.gd")
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Could not resolve member "v".
|
||||
@@ -0,0 +1,3 @@
|
||||
const B = preload("cyclic_ref_external.gd")
|
||||
|
||||
var v = B.v
|
||||
@@ -0,0 +1,9 @@
|
||||
func test():
|
||||
print(f1())
|
||||
print(f2())
|
||||
|
||||
static func f1(p := f2()) -> int:
|
||||
return 1
|
||||
|
||||
static func f2(p := f1()) -> int:
|
||||
return 2
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Could not resolve member "f1": Cyclic reference.
|
||||
@@ -0,0 +1,12 @@
|
||||
func test():
|
||||
print(v)
|
||||
|
||||
var v := InnerA.new().f()
|
||||
|
||||
class InnerA:
|
||||
func f(p := InnerB.new().f()) -> int:
|
||||
return 1
|
||||
|
||||
class InnerB extends InnerA:
|
||||
func f(p := 1) -> int:
|
||||
return super.f()
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Could not resolve member "f": Cyclic reference.
|
||||
@@ -0,0 +1,5 @@
|
||||
func test():
|
||||
print(v1)
|
||||
|
||||
var v1 := v2
|
||||
var v2 := v1
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Could not resolve member "v1": Cyclic reference.
|
||||
Reference in New Issue
Block a user