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:
ocean (they/them)
2023-05-21 19:22:00 -04:00
parent 7734146060
commit 861743cd04
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.