Permalink
Browse files

The '%' (mod) was missing in check_binop. So the following did not co…

…mpile

module TestMod = struct

    val main : unit -> unit
    let main () = 
        Print.int (7 % 2);
        Print.newline ()
end
  • Loading branch information...
vrotaru committed Sep 23, 2012
1 parent 82e2b8e commit 28846b9e66bfdc8fa763870310e01f0876bd43b5
Showing with 1 addition and 0 deletions.
  1. +1 −0 compiler/stastOfTast.ml
View
@@ -71,6 +71,7 @@ let check_binop op ((p, _) as ty) =
| Ast.Eminus, (Stast.Tint | Stast.Tfloat) -> ()
| Ast.Estar, (Stast.Tint | Stast.Tfloat) -> ()
| Ast.Ediv, (Stast.Tint | Stast.Tfloat) -> ()
+ | Ast.Emod, (Stast.Tint) -> ()
| Ast.Eor, (Stast.Tbool) -> ()
| Ast.Eand, (Stast.Tbool) -> ()
| _ -> Error.expected_numeric p

0 comments on commit 28846b9

Please sign in to comment.