mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
formatting & catch zig overflow error
This commit is contained in:
parent
0cc6e44d35
commit
4152519bfb
7 changed files with 19 additions and 26 deletions
|
@ -293,12 +293,12 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
// minInt : Int range
|
||||
add_type!(Symbol::NUM_MIN_INT, int_type(flex(TVAR1)));
|
||||
|
||||
// divInt : Int a, Int a -> Result (Int a) [ DivByZero ]*
|
||||
let div_by_zero = SolvedType::TagUnion(
|
||||
vec![(TagName::Global("DivByZero".into()), vec![])],
|
||||
Box::new(SolvedType::Wildcard),
|
||||
);
|
||||
|
||||
// divInt : Int a, Int a -> Result (Int a) [ DivByZero ]*
|
||||
add_top_level_function_type!(
|
||||
Symbol::NUM_DIV_INT,
|
||||
vec![int_type(flex(TVAR1)), int_type(flex(TVAR1))],
|
||||
|
@ -306,18 +306,12 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
);
|
||||
|
||||
//divCeil: Int a, Int a -> Result (Int a) [ DivByZero ]*
|
||||
let div_by_zero = SolvedType::TagUnion(
|
||||
vec![(TagName::Global("DivByZero".into()), vec![])],
|
||||
Box::new(SolvedType::Wildcard),
|
||||
);
|
||||
|
||||
add_top_level_function_type!(
|
||||
Symbol::NUM_DIV_CEIL,
|
||||
vec![int_type(flex(TVAR1)), int_type(flex(TVAR1))],
|
||||
Box::new(result_type(int_type(flex(TVAR1)), div_by_zero.clone())),
|
||||
);
|
||||
|
||||
|
||||
// bitwiseAnd : Int a, Int a -> Int a
|
||||
add_top_level_function_type!(
|
||||
Symbol::NUM_BITWISE_AND,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue