Skip to content

Final and non-instantiable classes #1162

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

Merged
merged 3 commits into from
May 12, 2025

Conversation

Bromeon
Copy link
Member

@Bromeon Bromeon commented May 11, 2025

Final classes cannot be inherited from. Attempting to do so will be met with a compile error:

#[derive(GodotClass)]
#[class(init, base=Os)]
struct MyClass {}
error: Class `Os` is final and cannot be inherited from.

Non-instantiable classes cannot be default-constructed; i.e. the NewGd/NewAlloc traits aren't implemented for them.
Examples here are all the tweeners.


Closes #1129.

@Bromeon Bromeon added this to the 0.3 milestone May 11, 2025
@Bromeon Bromeon added feature Adds functionality to the library c: engine Godot classes (nodes, resources, ...) breaking-change Requires SemVer bump labels May 11, 2025
@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-1162

@Bromeon Bromeon added this pull request to the merge queue May 12, 2025
Merged via the queue into master with commit adcb58d May 12, 2025
47 checks passed
@Bromeon Bromeon deleted the qol/final-and-uninstantiable-classes branch May 12, 2025 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Requires SemVer bump c: engine Godot classes (nodes, resources, ...) feature Adds functionality to the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't extend AudioStreamGeneratorPlayback
2 participants