Skip to content

Commit

Permalink
fix: Don't ICE on unapplied, aliased constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
Marwes committed Apr 4, 2019
1 parent 7b4a5a9 commit 2a44a0d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
23 changes: 23 additions & 0 deletions tests/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1092,3 +1092,26 @@ True
",
true
}

test_expr! {
recursive_eff_arr,
r#"
rec
type Eff (r : Type -> Type) a =
| Pure a
| Impure : forall x . Arr r x a -> Eff r a
type Arr r a b = a -> Eff r b
in
type Writer a = forall r . (.. r)
let any x = any x
let tell : Eff [| writer : Writer | r |] () =
Impure Pure
()
"#,
()
}
2 changes: 1 addition & 1 deletion vm/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ impl<'a> Compiler<'a> {
}
}
}
_ => ice!("ICE: Unexpected data type: {}", typ),
_ => ice!("ICE: Unexpected data type for {}: {}", id.name, typ),
}
}
}
Expand Down
1 change: 1 addition & 0 deletions vm/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,7 @@ impl<'a, 'e> Translator<'a, 'e> {
// has no effect and `typ` itself will be used
let data_type;
{
let typ = remove_aliases_cow(&self.env, &mut NullInterner, typ.remove_forall());
let mut args = arg_iter(typ.remove_forall());
unapplied_args = args
.by_ref()
Expand Down

0 comments on commit 2a44a0d

Please sign in to comment.