Skip to content

Add support for const item in component traits#95

Merged
soareschen merged 4 commits intomainfrom
const-in-component-trait
May 5, 2025
Merged

Add support for const item in component traits#95
soareschen merged 4 commits intomainfrom
const-in-component-trait

Conversation

@soareschen
Copy link
Collaborator

@soareschen soareschen commented May 5, 2025

Summary

This PR adds support for const items to be defined inside component traits that use #[cgp_component].

With this, we can for example define component traits such as:

#[cgp_component {
    provider: ConstantGetter
}]
pub trait HasConstant {
    const CONSTANT: u64;
}

@soareschen soareschen merged commit 5cc02c7 into main May 5, 2025
5 checks passed
@soareschen soareschen deleted the const-in-component-trait branch May 5, 2025 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant