-
Notifications
You must be signed in to change notification settings - Fork 216
Closed
astral-sh/ruff
#17998Labels
genericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementation
Description
As Type::Tuple is becoming more actively used in implementations, I think we should implement Homogeneous Tuples before the refactoring cost becomes too high.
I’m considering an implementation like the following using an enum:
Implementation blueprint (Outdated)
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub enum TupleType<'db> {
Heterogeneous(HeterogeneousTupleType<'db>),
Homogeneous(HomogeneousTupleType<'db>),
}
#[salsa::interned]
pub struct HeterogeneousTupleType<'db> {
elements: Box<[Type<'db>]>,
}
#[salsa::interned]
pub struct HomogeneousTupleType<'db> {
element: Type<'db>,
}Expected Issues
Currently, it seems that there is no way to assign a homogeneous tuple type in the tests.
Do you have any suggestions for a proper way to handle this? Or should we wait for another feature to be merged first?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
genericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementation