Index into Types

This commit is contained in:
Ayaz Hafiz 2022-11-02 17:17:39 -05:00
parent dad9a8e537
commit 5da11d7fdd
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -862,6 +862,14 @@ impl Polarity {
}
}
impl std::ops::Index<Index<TypeTag>> for Types {
type Output = TypeTag;
fn index(&self, index: Index<TypeTag>) -> &Self::Output {
&self.tags[index.index()]
}
}
#[derive(PartialEq, Eq)]
pub enum Type {
EmptyRec,