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

Can't use associated types in definition of associated refinement #825

Open
enjhnsn2 opened this issue Sep 26, 2024 · 3 comments
Open

Can't use associated types in definition of associated refinement #825

enjhnsn2 opened this issue Sep 26, 2024 · 3 comments

Comments

@enjhnsn2
Copy link
Collaborator

When I try to verify the code:

#[flux_rs::generics(Self as base)]
#[flux_rs::assoc(fn can_fit(self: Self, animal: Self::Animal) -> bool)]
trait Barn {
    type Animal;
    fn put_animal_in_house(&mut self, animal: Self::Animal);
}

It fails with:

error[E0999]: cannot find sort `Self::Animal` in this scope
   --> src/main.rs:700:49
    |
700 | #[flux_rs::assoc(fn can_fit(self: Self, animal: Self::Animal) -> bool)]
    |                                                 ^^^^^^^^^^^^ not found in this scope

Is there a trick to referencing associated types within an associated refinement definition, or is this feature currently unsupported in Flux?

@nilehmann
Copy link
Member

This is currently unsupported.

@ranjitjhala
Copy link
Contributor

Is is this popping up a lot? i.e. should I work on this first or #808 ?

@enjhnsn2
Copy link
Collaborator Author

@ranjitjhala This issue is more of a direct blocker atm, since specifying the MPU trait requires this feature.

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

No branches or pull requests

3 participants