GDScript: Add error when exporting node in non [Node]-derived classes

This commit is contained in:
Danil Alexeev
2023-10-05 13:50:26 +03:00
parent c7ed5d795e
commit 9e2273abc7
12 changed files with 119 additions and 50 deletions

View File

@@ -0,0 +1,8 @@
# GH-82809
extends Resource
@export var node: Node
func test():
pass

View File

@@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Node export is only supported in Node-derived classes, but the current class inherits "Resource".

View File

@@ -0,0 +1,9 @@
# GH-82809
extends Node
class Inner:
@export var node: Node
func test():
pass

View File

@@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Node export is only supported in Node-derived classes, but the current class inherits "RefCounted".

View File

@@ -0,0 +1,8 @@
# GH-82809
extends Resource
@export var node_array: Array[Node]
func test():
pass

View File

@@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Node export is only supported in Node-derived classes, but the current class inherits "Resource".