You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently working on a game with a lot of class inheritance where each child class adds more instance variables on top of its parent. It seems that once the inheritance tree gets complex enough Godot starts throwing errors on variable declarations while instancing objects. Here is a screenshot of an error that occurs when a resource is loaded from a file:
This seems to happen somewhat randomly, sometimes it has no issue instancing an object and other times it throws an error (seems to only happen on the most complex objects/the ones with the deepest inheritance trees). Tool scripts and whether or not a variable is exported makes no difference.
Steps to reproduce
I think this error is caused by Godot not handling large projects with deep inheritance trees very well. I can't pinpoint exactly what causes it, but it seems to have something to do with the amount of variables/identifiers a class has.
Minimal reproduction project
I wasn't able to reproduce this in a test project when I copied all of my class code and deleted all functions. It seems to require a fairly complex codebase to reproduce, and for multiple reasons I don't want to post my entire game.
The text was updated successfully, but these errors were encountered:
With more testing I think this error is caused by a indirect loops in class references. Seems like the error message could use some work or the parser could be improved to handle these kinds of loops. This does seem to be a duplicate of #74253 so it can probably be closed.
Godot version
4.0.1
System information
Windows 10, RTX 2060, Vulkan
Issue description
I'm currently working on a game with a lot of class inheritance where each child class adds more instance variables on top of its parent. It seems that once the inheritance tree gets complex enough Godot starts throwing errors on variable declarations while instancing objects. Here is a screenshot of an error that occurs when a resource is loaded from a file:
This seems to happen somewhat randomly, sometimes it has no issue instancing an object and other times it throws an error (seems to only happen on the most complex objects/the ones with the deepest inheritance trees). Tool scripts and whether or not a variable is exported makes no difference.
Steps to reproduce
I think this error is caused by Godot not handling large projects with deep inheritance trees very well. I can't pinpoint exactly what causes it, but it seems to have something to do with the amount of variables/identifiers a class has.
Minimal reproduction project
I wasn't able to reproduce this in a test project when I copied all of my class code and deleted all functions. It seems to require a fairly complex codebase to reproduce, and for multiple reasons I don't want to post my entire game.
The text was updated successfully, but these errors were encountered: