mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
Implemenet code gen for int div
This commit is contained in:
parent
ace50f9aac
commit
aa72619952
3 changed files with 35 additions and 5 deletions
|
@ -285,13 +285,19 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
Box::new(SolvedType::Wildcard),
|
||||
);
|
||||
|
||||
// div : Int, Int -> Result Int [ DivByZero ]*
|
||||
// // div : Int, Int -> Result Int [ DivByZero ]*
|
||||
// add_type(
|
||||
// Symbol::INT_DIV,
|
||||
// SolvedType::Func(
|
||||
// vec![int_type(), int_type()],
|
||||
// Box::new(result_type(flex(TVAR1), div_by_zero.clone())),
|
||||
// ),
|
||||
// );
|
||||
|
||||
// div : Int, Int -> Int
|
||||
add_type(
|
||||
Symbol::INT_DIV,
|
||||
SolvedType::Func(
|
||||
vec![int_type(), int_type()],
|
||||
Box::new(result_type(flex(TVAR1), div_by_zero.clone())),
|
||||
),
|
||||
SolvedType::Func(vec![int_type(), int_type()], Box::new(int_type())),
|
||||
);
|
||||
|
||||
// mod : Int, Int -> Result Int [ DivByZero ]*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue