Skip to content

Commit

Permalink
Ensure type-aliases pretty-printing also work with Pair.
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ authored and MicroProofs committed Apr 16, 2024
1 parent a4b4217 commit 0035b52
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions crates/aiken-lang/src/tipo/pretty.rs
Expand Up @@ -249,6 +249,21 @@ fn resolve_alias(
result
}

(
Annotation::Pair { fst, snd, .. },
Type::Pair {
fst: t_fst,
snd: t_snd,
..
},
) => {
let mut result = None;
for (ann, t) in [fst, snd].into_iter().zip([t_fst, t_snd]) {
result = result.or_else(|| resolve_one(parameter, ann, t.clone()));
}
result
}

(Annotation::Var { name, .. }, ..) if name == parameter => Some(typ),

_ => None,
Expand Down

0 comments on commit 0035b52

Please sign in to comment.