mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
GDScript: add errors when calling unimplemented virtual functions
This PR does a small refactor of how method flags are handled in the GDScript analyzer. This way, it adds support for the analyzer to use any of MethodInfo's flags, where previously it could only use METHOD_FLAG_STATIC and METHOD_FLAG_VARARG. As a side-effect, this also normalizes behavior between editor and release templates, which fixes #76938. The tests added also brought a different issue to light, where using `super()` appears to generate a return variable discarded on calling super's _init(), which doesn't have a return value. This should be tackled in a different PR, which will have to change the output of this PR's tests.
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.
|
||||
Reference in New Issue
Block a user