esumii/min-caml

How do min-caml catch the type error?

Closed this issue · 1 comments

zsdz commented

the example ack.ml under floder test:

let rec ack x y =
 if x <= 0 then y + 1 else
 if y <= 0 then ack (x - 1) 1 else
 ack (x - 1) (ack x (y - 1)) in
print_int (ack 3 10)

if I change the line

print_int (ack 3 10)

to this:

print_int (ack 3 1.23)

then make,got error:

Fatal error:exception Typing.Error(_,2,3)

I search the sorce,can't find info of Typing.Error,or Fatal.so how min-caml catch the type error?The ocaml compiler display in other way:

Error:this expression has type float but an expression was expected of type int

so where is the info

Fatal error:exception Typing.Error(_,2,3)

from?Thanks!