diff --git a/schala-lang/language/src/builtin.rs b/schala-lang/language/src/builtin.rs index f44848f..2d8c080 100644 --- a/schala-lang/language/src/builtin.rs +++ b/schala-lang/language/src/builtin.rs @@ -35,7 +35,33 @@ pub enum Builtin { impl Builtin { pub fn get_type(&self) -> Type { - ty!(Nat -> Nat -> Nat) + use Builtin::*; + match self { + Add => ty!(Nat -> Nat -> Nat), + Subtract => ty!(Nat -> Nat -> Nat), + Multiply => ty!(Nat -> Nat -> Nat), + Divide => ty!(Nat -> Nat -> Float), + Quotient => ty!(Nat -> Nat -> Nat), + Modulo => ty!(Nat -> Nat -> Nat), + Exponentiation => ty!(Nat -> Nat -> Nat), + BitwiseAnd => ty!(Nat -> Nat -> Nat), + BitwiseOr => ty!(Nat -> Nat -> Nat), + BooleanAnd => ty!(Bool -> Bool -> Bool), + BooleanOr => ty!(Bool -> Bool -> Bool), + BooleanNot => ty!(Bool -> Bool), + Equality => ty!(Nat -> Nat -> Bool), + LessThan => ty!(Nat -> Nat -> Bool), + LessThanOrEqual => ty!(Nat -> Nat -> Bool), + GreaterThan => ty!(Nat -> Nat -> Bool), + GreaterThanOrEqual => ty!(Nat -> Nat -> Bool), + Comparison => ty!(Nat -> Nat -> Ordering), + FieldAccess => ty!(Unit), + IOPrint => ty!(Unit), + IOPrintLn => ty!(Unit) , + IOGetLine => ty!(StringT), + Assignment => ty!(Unit), + Concatenate => ty!(StringT -> StringT -> StringT), + } } }