1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-04 19:21:46 +00:00

GDScript: Add missing member type check when resolving extends

(cherry picked from commit 66279b98b6)
This commit is contained in:
Danil Alexeev
2023-04-10 09:54:53 +03:00
committed by Yuri Sizov
parent 3a5bc7455e
commit d31002cfbe
7 changed files with 58 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
# GH-75870
const A = 1
class B extends A:
pass
func test():
pass

View File

@@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Constant "A" is not a preloaded script or class.

View File

@@ -0,0 +1,12 @@
# GH-75870
class A:
const X = 1
const Y = A.X # A.X is now resolved.
class B extends A.X:
pass
func test():
pass

View File

@@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Identifier "X" is not a preloaded script or class.

View File

@@ -0,0 +1,9 @@
# GH-75870
var A = 1
class B extends A:
pass
func test():
pass

View File

@@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot use variable "A" in extends chain.