Skip to content

Conversation

@jitspoe
Copy link
Contributor

@jitspoe jitspoe commented Oct 16, 2025

Execution can resume from the debugger and will continue executing code in the function instead of bailing out early.

Fix for #34054

…ume from the debugger and will continue executing code in the function instead of bailing out early.
@dalexeev
Copy link
Member

If you find a difference between the engine's behavior and the documentation, it does not necessarily mean that there is a bug in the engine. Documentation can have errors too.

In my opinion, the current behavior is more reasonable. As far as I know, in most languages, failure to satisfy assert conditions either results in abnormal program termination or throws an exception. Godot/GDScript doesn't have exceptions, so their shallow equivalent in this case is function exit. This is quite reasonable: if the assert condition is not met, then a significant logical error has occurred somewhere, the function's expectations are fundamentally broken, and continuing its execution makes no sense and may even be dangerous.

You might argue that this creates a difference between debug and release versions. But this difference also exists in other languages ​​where you can disable assertions. The mechanism by which assert works is not important here: whether it terminates the program abnormally, throws an exception, or exits the function - there will be differences between the versions with assertions enabled and disabled, that's the idea behind assert. The only thing that matters is its behavior in the debug version, not the differences between the debug and release versions.

@jitspoe
Copy link
Contributor Author

jitspoe commented Oct 16, 2025

Probably makes more sense to keep discussions on the proposal, so I've made a comment there: godotengine/godot-proposals#13111 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants