floats iter 3.3: install Float constants nan/inf/neg_inf + io/print_float effect op

This commit is contained in:
2026-05-10 15:35:19 +02:00
parent 60a4c687b3
commit fd3f74cfa0
2 changed files with 88 additions and 1 deletions
+6 -1
View File
@@ -177,6 +177,11 @@ pub(crate) fn builtin_ail_type(name: &str) -> Option<Type> {
param_modes: vec![],
ret_mode: ParamMode::Implicit,
},
// Iter 22-floats.3: Float bit-pattern constants. Bare values,
// not fns — referenced via `Term::Var`. Mirrors the
// typechecker's `builtins::install`. Codegen emits LLVM hex-
// float literals at the use site in iter 4.
"nan" | "inf" | "neg_inf" => Type::float(),
_ => return None,
})
}
@@ -185,7 +190,7 @@ pub(crate) fn builtin_ail_type(name: &str) -> Option<Type> {
/// param signature is irrelevant here since we only consume the ret.
pub(crate) fn builtin_effect_op_ret(op: &str) -> Option<Type> {
Some(match op {
"io/print_int" | "io/print_bool" | "io/print_str" => Type::unit(),
"io/print_int" | "io/print_bool" | "io/print_str" | "io/print_float" => Type::unit(),
_ => return None,
})
}