mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
Merge remote-tracking branch 'origin/trunk' into overflow_on_mul
This commit is contained in:
commit
a656778968
17 changed files with 555 additions and 152 deletions
|
@ -1242,36 +1242,34 @@ fn lift(u: VarId, a: SolvedType) -> SolvedType {
|
|||
|
||||
#[inline(always)]
|
||||
fn float_type(u: VarId) -> SolvedType {
|
||||
let b_64 = builtin_aliases::binary64_type();
|
||||
let attr_b_64 = lift(u, b_64);
|
||||
let fp = builtin_aliases::floatingpoint_type(attr_b_64);
|
||||
let attr_fb = lift(u, fp);
|
||||
let num = builtin_aliases::num_type(attr_fb);
|
||||
|
||||
SolvedType::Apply(
|
||||
Symbol::ATTR_ATTR,
|
||||
vec![
|
||||
flex(u),
|
||||
SolvedType::Alias(
|
||||
Symbol::NUM_F64,
|
||||
Vec::new(),
|
||||
Box::new(builtin_aliases::num_type(SolvedType::Apply(
|
||||
Symbol::ATTR_ATTR,
|
||||
vec![flex(u), builtin_aliases::floatingpoint_type()],
|
||||
))),
|
||||
),
|
||||
SolvedType::Alias(Symbol::NUM_F64, Vec::new(), Box::new(num)),
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn int_type(u: VarId) -> SolvedType {
|
||||
let signed_64 = builtin_aliases::signed64_type();
|
||||
let attr_signed_64 = lift(u, signed_64);
|
||||
let integer = builtin_aliases::integer_type(attr_signed_64);
|
||||
let attr_fb = lift(u, integer);
|
||||
let num = builtin_aliases::num_type(attr_fb);
|
||||
|
||||
SolvedType::Apply(
|
||||
Symbol::ATTR_ATTR,
|
||||
vec![
|
||||
flex(u),
|
||||
SolvedType::Alias(
|
||||
Symbol::NUM_I64,
|
||||
Vec::new(),
|
||||
Box::new(builtin_aliases::num_type(SolvedType::Apply(
|
||||
Symbol::ATTR_ATTR,
|
||||
vec![flex(u), builtin_aliases::integer_type()],
|
||||
))),
|
||||
),
|
||||
SolvedType::Alias(Symbol::NUM_I64, Vec::new(), Box::new(num)),
|
||||
],
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue