Skip to content

Commit

Permalink
frontend: Prepare IndexGet and IndexSet traits
Browse files Browse the repository at this point in the history
  • Loading branch information
dinfuehr committed Nov 9, 2024
1 parent 2824657 commit f4a4487
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dora-frontend/src/sema/known.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ pub struct KnownTraits {
pub stringable: Option<TraitDefinitionId>,
pub sub: Option<TraitDefinitionId>,
pub zero: Option<TraitDefinitionId>,
pub index_get: Option<TraitDefinitionId>,
pub index_set: Option<TraitDefinitionId>,
}

impl KnownTraits {
Expand All @@ -210,6 +212,8 @@ impl KnownTraits {
stringable: None,
sub: None,
zero: None,
index_get: None,
index_set: None,
}
}

Expand Down
10 changes: 10 additions & 0 deletions pkgs/std/traits.dora
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,13 @@ pub trait IntoIterator {
type IteratorType: Iterator;
fn iter(): Self::IteratorType;
}

// pub trait IndexGet[T] {
// type Item;
// fn get(index: T): Self::Item;
// }

// pub trait IndexSet[T] {
// type Item;
// fn set(index: T, value: Self::Item);
// }

0 comments on commit f4a4487

Please sign in to comment.