Merge pull request #77324 from anvilfolk/oh-no-its-virtual
GDScript: add errors when calling unimplemented virtual functions
This commit is contained in:
commit
49b774e009
8 changed files with 61 additions and 32 deletions
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue