Skip to content

Commit

Permalink
typ -> type
Browse files Browse the repository at this point in the history
  • Loading branch information
jfecher committed Aug 1, 2023
1 parent 2a9de51 commit c346c83
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/noirc_frontend/src/ast/type_alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ impl NoirTypeAlias {
impl Display for NoirTypeAlias {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let generics = vecmap(&self.generics, |generic| generic.to_string());
write!(f, "type {}<{}> = {}", self.name, generics.join(", "), self.ty)
write!(f, "type {}<{}> = {}", self.name, generics.join(", "), self.typ)
}
}
6 changes: 3 additions & 3 deletions crates/noirc_frontend/src/hir/def_collector/dc_mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,18 @@ impl<'a> ModCollector<'a> {
type_alias_def: type_alias,
};

let typ_alias_id = context.def_interner.push_type_alias(&unresolved);
let type_alias_id = context.def_interner.push_type_alias(&unresolved);

// Add the type alias to scope so its path can be looked up later
let result = self.def_collector.def_map.modules[self.module_id.0]
.declare_type_alias(name, typ_alias_id);
.declare_type_alias(name, type_alias_id);

if let Err((first_def, second_def)) = result {
let err = DefCollectorErrorKind::DuplicateFunction { first_def, second_def };
errors.push(err.into_file_diagnostic(self.file_id));
}

self.def_collector.collected_type_aliases.insert(typ_alias_id, unresolved);
self.def_collector.collected_type_aliases.insert(type_alias_id, unresolved);
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/noirc_frontend/src/parser/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ fn type_alias_definition() -> impl NoirParser<TopLevelStatement> {
let p = then_commit_ignore(p, just(Token::Assign));
let p = then_commit(p, parse_type());

p.map_with_span(|((name, generics), ty), span| {
TopLevelStatement::TypeAlias(NoirTypeAlias { name, generics, ty, span })
p.map_with_span(|((name, generics), typ), span| {
TopLevelStatement::TypeAlias(NoirTypeAlias { name, generics, typ, span })
})
}

Expand Down

0 comments on commit c346c83

Please sign in to comment.