Project

General

Profile

« Previous | Next » 

Revision 1577dc7e

Added by Xavier Thirioux over 9 years ago

better error message for tuple type mismatch

git-svn-id: https://cavale.enseeiht.fr/svn/lustrec/lustre_compiler/trunk@161 041b043f-8d7c-46b2-b46e-ef0dd855326e

View differences:

src/typing.ml
309 309
(*Format.eprintf "subtyping const %B real %a:%a vs formal %a@." const Printers.pp_expr real_arg Types.print_ty real_type Types.print_ty formal_type;*)
310 310
  let real_types   = type_list_of_type real_type in
311 311
  let formal_types = type_list_of_type formal_type in
312
  try
313
    List.iter2 (type_subtyping loc sub) real_types formal_types
314
  with _ -> raise (Unify (real_type, formal_type))
312
  if (List.length real_types) <> (List.length formal_types)
313
  then raise (Unify (real_type, formal_type))
314
  else List.iter2 (type_subtyping loc sub) real_types formal_types
315 315

  
316 316
and type_subtyping loc sub real_type formal_type =
317 317
  match (repr real_type).tdesc, (repr formal_type).tdesc with

Also available in: Unified diff