Merge pull request #77324 from anvilfolk/oh-no-its-virtual

GDScript: add errors when calling unimplemented virtual functions
This commit is contained in:
Rémi Verschelde
2023-06-15 15:26:18 +02:00
8 changed files with 61 additions and 32 deletions

View File

@ -0,0 +1,2 @@
func test():
_get_property_list()

View File

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot call virtual function "_get_property_list()" because it hasn't been defined.

View File

@ -0,0 +1,5 @@
func _init():
super()
func test():
pass

View File

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot call the parent class' virtual function "_init()" because it hasn't been defined.

View File

@ -0,0 +1,11 @@
class TestOne:
func _get_property_list():
return {}
class TestTwo extends TestOne:
func _init():
var _x = _get_property_list()
func test():
var x = TestTwo.new()
var _x = x._get_property_list()