mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Index into Types
This commit is contained in:
parent
dad9a8e537
commit
5da11d7fdd
1 changed files with 8 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue