Skip to content
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

Support Trait Inheritance #3949

Open
Tracked by #2568
sirasistant opened this issue Jan 4, 2024 · 0 comments
Open
Tracked by #2568

Support Trait Inheritance #3949

sirasistant opened this issue Jan 4, 2024 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@sirasistant
Copy link
Contributor

sirasistant commented Jan 4, 2024

Problem

We'd like to be able to define a trait as a combination of other traits.

Happy Case

The following syntax should compile:

trait Backend: SmartContract + ProofSystemCompiler + Default + Debug {}

Alternatives Considered

It can be worked around by creating a blanket implementation for the trait Backend for all types that implement SmartContract + ProofSystemCompiler + Default + Debug but it's not ideal.

Another workaround is to have each function with a T: Backend bound replaced with the inherited bounds instead: T: SmartContract + ProofSystemCompiler + Default + Debug

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@sirasistant sirasistant added the enhancement New feature or request label Jan 4, 2024
@Savio-Sou Savio-Sou mentioned this issue Jan 8, 2024
46 tasks
@jfecher jfecher changed the title Combining traits Support Trait Inheritance Jan 8, 2024
@kevaundray kevaundray added this to the 1.0 milestone Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 📋 Backlog
Development

No branches or pull requests

5 participants