-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Accessing keys() dict of an enum defined in a singleton crashes app #70495
Comments
I can confirm this, I ran into it in one of my own projects, wasn't sure what in my project was triggering it. It also happens if the enum is accessed via the class name.
I'd open a separate issue for these errors if I could figure out an MRP. |
I've also bisected a crash in my main project caused by #70220, likely related. Backtrace dump:
|
Well.. because I have singleton with enums and I use keys() I can suppose I have the same problem too inv 4.0.beta10.official [d0398f6] lots of these at start:
Thanks |
CC @anvilfolk, the enum specialist. |
@akien-mga Fortunately, our PR #70246 fixes this issue. |
I got the following errors too:
And sometimes crash (
|
It would be absolutely excellent if someone could provide an MRP for these |
Here's the reason: extends Node
func _ready() -> void:
print(MyClass.MyEnum.size()) MRP: issue-70495.zip EDIT: I fixed |
💯 thank you! Will look into it!! :) |
I think these cases should be added to the tests to reduce the chance of such regressions in the future. |
Oh, perfect call, I'll do that now! Thanks for the reminder, I always forget it for myself :) We're slowly building a bigger and bigger test suite that will hopefully catch a whole lot more. |
So actually, I just realized this doesn't happen when enums are in the same file, so there's something else happening here that's throwing me for a loop and I want to dig a little more, because I might've fixed a symptom and not a cause. |
Godot version
beta10
System information
Windows10
Issue description
With beta10, when an enum is defined in an autoloaded script, calling the keys() method on the enum crash the app.
Works well if the enum is not defined in a singleton.
Worked well in beta9
Steps to reproduce
1°) Define an enum in a script and make it as an autoloaded script in your project.
2°) Try to access this enum keys() method from another script
Should work in beta9 but crash in beta10
Minimal reproduction project
global_enum_bug.zip
The text was updated successfully, but these errors were encountered: