FLOAT_ABS test, and NUM_ABS generally, but not implemented

This commit is contained in:
Chad Stearns 2020-05-08 00:49:08 -04:00
parent be5641e35a
commit 8e8412bf94
6 changed files with 45 additions and 2 deletions

View file

@ -285,6 +285,12 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
SolvedType::Func(vec![int_type(), int_type()], Box::new(bool_type())),
);
// abs : Int -> Int
add_type(
Symbol::INT_ABS,
SolvedType::Func(vec![int_type()], Box::new(int_type())),
);
// highest : Int
add_type(Symbol::INT_HIGHEST, int_type());
@ -336,6 +342,12 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
SolvedType::Func(vec![float_type()], Box::new(int_type())),
);
// abs : Float -> Float
add_type(
Symbol::FLOAT_ABS,
SolvedType::Func(vec![float_type()], Box::new(float_type())),
);
// highest : Float
add_type(Symbol::FLOAT_HIGHEST, float_type());