fix some things in Num

This commit is contained in:
Folkert 2022-04-08 20:24:17 +02:00
parent 4dafe08544
commit e9f7427c67
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
3 changed files with 8 additions and 2 deletions

View file

@ -140,6 +140,8 @@ interface Num
toU64Checked, toU64Checked,
toU128, toU128,
toU128Checked, toU128Checked,
toNat,
toNatChecked,
toF32, toF32,
toF32Checked, toF32Checked,
toF64, toF64,
@ -354,6 +356,7 @@ toU16 : Int * -> U16
toU32 : Int * -> U32 toU32 : Int * -> U32
toU64 : Int * -> U64 toU64 : Int * -> U64
toU128 : Int * -> U128 toU128 : Int * -> U128
toNat : Int * -> Nat
toF32 : Num * -> F32 toF32 : Num * -> F32
toF64 : Num * -> F64 toF64 : Num * -> F64
@ -368,5 +371,6 @@ toU16Checked : Int * -> Result U16 [ OutOfBounds ]*
toU32Checked : Int * -> Result U32 [ OutOfBounds ]* toU32Checked : Int * -> Result U32 [ OutOfBounds ]*
toU64Checked : Int * -> Result U64 [ OutOfBounds ]* toU64Checked : Int * -> Result U64 [ OutOfBounds ]*
toU128Checked : Int * -> Result U128 [ OutOfBounds ]* toU128Checked : Int * -> Result U128 [ OutOfBounds ]*
toNatChecked : Int * -> Result Nat [ OutOfBounds ]*
toF32Checked : Num * -> Result F32 [ OutOfBounds ]* toF32Checked : Num * -> Result F32 [ OutOfBounds ]*
toF64Checked : Num * -> Result F64 [ OutOfBounds ]* toF64Checked : Num * -> Result F64 [ OutOfBounds ]*

View file

@ -396,7 +396,7 @@ pub fn canonicalize_module_defs<'a>(
if has_no_implementation(&def.loc_expr.value) { if has_no_implementation(&def.loc_expr.value) {
match generated_info { match generated_info {
GeneratedInfo::Builtin { GeneratedInfo::Builtin {
generated_functions, generated_functions: _,
} => { } => {
let symbol = def.pattern_vars.iter().next().unwrap().0; let symbol = def.pattern_vars.iter().next().unwrap().0;
match crate::builtins::builtin_defs_map(*symbol, var_store) { match crate::builtins::builtin_defs_map(*symbol, var_store) {

View file

@ -2460,7 +2460,9 @@ fn foo<'a>(
packages: &[], packages: &[],
exposes: unspace(arena, header.exposes.items), exposes: unspace(arena, header.exposes.items),
imports: unspace(arena, header.imports.items), imports: unspace(arena, header.imports.items),
extra: HeaderFor::Interface, extra: HeaderFor::Builtin {
generates_with: &[],
},
}; };
(info, parse_state) (info, parse_state)