iter 22b.2.1: add Constraint struct, Type::Forall.constraints

This commit is contained in:
2026-05-09 17:34:39 +02:00
parent e1d748d64e
commit b636b883a3
14 changed files with 94 additions and 20 deletions
+2
View File
@@ -83,6 +83,7 @@ pub(crate) fn builtin_ail_type(name: &str) -> Option<Type> {
// constant i1 1) on those resolved types.
"==" => Type::Forall {
vars: vec!["a".into()],
constraints: vec![],
body: Box::new(Type::Fn {
params: vec![
Type::Var { name: "a".into() },
@@ -105,6 +106,7 @@ pub(crate) fn builtin_ail_type(name: &str) -> Option<Type> {
// (`forall a. a`). Mirrors the typechecker's `builtins::install`.
"__unreachable__" => Type::Forall {
vars: vec!["a".into()],
constraints: vec![],
body: Box::new(Type::Var { name: "a".into() }),
},
_ => return None,