Derive `GodotClass` for traits
Open
c: register
feature
hard
- Dominant language
- Rust
- Stars
- 5.2k
- Forks
- 312
- Avg merge
- 12h 59m
- Merged PRs (30d)
- 9
Description
similar to #334, a possible way to add restricted inheritance would be to allow traits to derive `GodotClass`. This would turn that trait into an abstract class. Then later we could allow people to inherit from this base class by implementing the trait.
i haven't thought out many details of this, but it has the advantage over doing it for enums that we dont need to enumerate all possible children immediately. it's also more similar in both godot and rust.
we could possibly integrate this with traits in gdscript when they're added: https://github.com/godotengine/godot-proposals/issues/6416
We'd probably need to make the trait a subtrait of `Inherits`.
Contributor guide
Assessment
This issue has not been assessed yet.