Merge pull request #77324 from anvilfolk/oh-no-its-virtual
GDScript: add errors when calling unimplemented virtual functions
This commit is contained in:
@ -0,0 +1,2 @@
|
||||
func test():
|
||||
_get_property_list()
|
||||
@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Cannot call virtual function "_get_property_list()" because it hasn't been defined.
|
||||
@ -0,0 +1,5 @@
|
||||
func _init():
|
||||
super()
|
||||
|
||||
func test():
|
||||
pass
|
||||
@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Cannot call the parent class' virtual function "_init()" because it hasn't been defined.
|
||||
@ -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()
|
||||
@ -0,0 +1 @@
|
||||
GDTEST_OK
|
||||
Reference in New Issue
Block a user