Open PabloNeirotti opened 1 year ago
Okay I just tested this on beta 11, and the issue persists. I still need to restart Godot every time I create a new function 😅 or I'll get a parser error.
The Output throws this when I save, with pending changes both in the super class and the inheriting class:
res://MyCustomClass.gd:44 - Parse Error: Function "new_func()" not found in base self.
modules/gdscript/gdscript_compiler.cpp:2339 - Condition "!base->is_valid() && !base->reloading" is true. Returning: ERR_BUG
modules/gdscript/gdscript_compiler.cpp:2339 - Condition "!base->is_valid() && !base->reloading" is true. Returning: ERR_BUG
For context, I'm trying to call new_func()
from the inheriting class, which I just defined in the super class.
I can verify that I also experience this issue in Release Candidate 1.
Confirming that I'm also experiencing this in 4.0 stable
Experiencing this in 4.1 stable as well
I just made it a habit of restarting the project every time I create a method. It's very slow, but better than getting a typo on your code 😄
experiencing the same issue using Godot v4.1.1-stable-win64 (it involves both variables and functions)
experiencing this issue, but with at first level of inheritance
Experiencing this as well with super()
. (Godot 4.2.1.stable.official [b09f793f5])
Hey, I know I might be late, but I'm using Godot 4.2 stable and I am experiencing this very same problem.
Weirdly, the bug was only triggered to me when I wrote a function in the body of Class C (which extends Class B which extends Class A which extends CharacterBody2D) and called it from another function in Class D (which extends Class C).
I've just found an easy turn around: I transformed my Class C function into a Callable, and now it detects no error when calling its "call" method from Class D.
Not the ideal solution but one nonetheless...
By the way, I wanted to try to find the source of the error myself and craft a bug fix. Is there any documentation besides the "Engine Development" in "Contribution" in "Godot Docs" that I could look into for that purpose?
Thanks for the attention.
This issue still occurs in v4.2.2.stable.official [15073afe3]
It happens as far as I can tell with any and all parts of a custom class, not just methods, nor just inheritance. The editor will just seemingly decide that it doesn't feel like updating its list of classes and anything contained therein. So I won't be able to access properties, methods, or sometimes even the class itself. It feels like some kind of cache issue, but that's just an uninformed hunch.
It's how I get errors like this despite the code being and the only way to get the editor to recognize the change is to reload the project. If this happened like once a month, it'd be an annoyance, sure, but it happens constantly which turns it into a workflow nightmare.
I have seen really no rhyme or reason to it over the past 6 months. Sometimes Classes play nice, other times they go completely nuclear. It's maddening, especially for newer people who don't realize it's an engine bug happening, and waste hours trying to figure out what they're doing wrong.
havent tested, but should be fixed by https://github.com/godotengine/godot/pull/92616
havent tested, but should be fixed by #92616
I tried to test but I didn't manage to reproduce the bug in 4.2.2-stable after several attempts at following the steps in the OP.
So if someone who can reproduce the bug easily can test in 4.3-beta3 or later once it's released, that would be great.
Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.
Godot version
v4.0.beta10.official [d0398f62f]
System information
Apple M1 Max - macOS Ventura 13.1 (22C65)
Issue description
I'm actually not sure when this bug was introduced, or if it exists in v3 too.
Adding a new method on a super class, and then calling it from an extending class, triggers a "not found" error in the editor. The code however can run fine when running the scene.
See attached video:
https://user-images.githubusercontent.com/905216/210248116-f5af4af4-13f1-4755-a9a0-ffb49d571237.mov
Steps to reproduce
ClassA
→ClassB
→ClassC
→ClassD
ClassA
ClassD
Minimal reproduction project
I am sharing the project I created to reproduce some bugs in the editor, but it still requires redoing the steps on your end to trigger this, since restarting the editor fixes the issue.
Godot Crash Test.zip