|
@@ -44,10 +44,11 @@ let check_type ?(msg="") expected node =
|
|
|
let got = typeof node in
|
|
let got = typeof node in
|
|
|
if (spec got) <> (spec expected) then begin
|
|
if (spec got) <> (spec expected) then begin
|
|
|
let msg = match msg with
|
|
let msg = match msg with
|
|
|
- | "" -> sprintf "type mismatch: expected type %s, got %s"
|
|
|
|
|
- (type2str_error expected) (type2str_error got)
|
|
|
|
|
- | _ -> msg
|
|
|
|
|
- in raise (NodeError (node, msg))
|
|
|
|
|
|
|
+ | "" -> sprintf "type mismatch: expected type %s, got %s"
|
|
|
|
|
+ (type2str_error expected) (type2str_error got)
|
|
|
|
|
+ | _ -> msg
|
|
|
|
|
+ in
|
|
|
|
|
+ raise (NodeError (node, msg))
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
let op_types = function
|
|
let op_types = function
|