-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GDScript 2.0: Incorrect base class when using extends Class.Subclass
#65953
Comments
extends Class.Subclass
Another one that might be related to #65752 (not sure if it will fix it though, as this one is not about class inheritance per-se but more about the script type) |
I had to stop programming for my mental health, but if anyone wants to pick up where I left off, my WIP branch is here: |
@adamscott staring at you for no reason whatsoever. @rune-scape get well soon. 🖤 |
Take care, @rune-scape |
@rune-scape I think I fixed your issue with my new cyclic references PR #67714 ! |
@adamscott I found a lot of edge cases where subclasses aren't considered when I was trying to switch extends to use |
@rune-scape You mean that it was built on #65752, I completely redid my PR from scratch. I'll try to take a look to your PR one more time, to see what you did in resolve datatype. |
@rune-scape Unfortunately, there's too many changes for me, in your branch, to be confortable to integrate it in #67714, especially as it just been approved by a reviewer. If you create a PR, I'll make sure to work with you to help you refactor |
Ah
Sounds good, ill start in a few days |
So I did it Again and I have to stop programming, but @adamscott, #68086. not working yet, but it runs |
@rune-scape Take your time. Especially for yourself. 💜 |
Note to the Godot Maintainers: my PR (#67714) shouldn't mark this issue as resolved. That honour should go to @rune-scape 's PR #68374 as it's solution is way more deep that mine could ever be. |
Godot version
20d6672
System information
Windows 10 x64
Issue description
When using 'extends BaseClass.Subclass' the class extended is 'BaseClass'. Kinda.
All super calls will go to A, not B, but Analyzer still knows B is the intended super class.
The
GDScriptDataType::script_type
for the identifier is set wrong in i think 'resolve_inheritance' or 'reduce_identifier_from_base' in GDScriptAnalyser. Or left unset?Something to do with the subclass class member not getting its script type resolved.
GDScriptDataType::script_type
is not set right by the time it gets to GDScriptCompiler when it sets the 'base' ptr in GDScript, where all super calls go.Tested on Beta 1
Steps to reproduce
Use the dot notation in an extends clause, like (extends A.B).
All super calls will go to A, not B, but Analyzer still knows B is the intended super class
Minimal reproduction project
GodotInheritanceBugProject.zip
Running the project will print:
When it should print:
The text was updated successfully, but these errors were encountered: