Project

General

Profile

« Previous | Next » 

Revision 9b5969d4

Added by Xavier Thirioux almost 10 years ago

corrected wrong subtyping rule for tuple assignment

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

View differences:

src/typing.ml
306 306
	 | Some d' -> try_unify real_type real_static_type loc);
307 307
	 real_static_type
308 308
    else real_type in
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;*)
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
  match (repr real_type).tdesc, (repr formal_type).tdesc with
311 311
  | Tstatic _          , Tstatic _ when sub -> try_unify formal_type real_type loc
312 312
  | Tstatic (r_d, r_ty), _         when sub -> try_unify formal_type r_ty loc
......
486 486
    List.fold_left (fun uvars v -> define_var v uvars) undefined_vars eq.eq_lhs in
487 487
  (* Type rhs wrt to lhs type with subtyping, i.e. a constant rhs value may be assigned
488 488
     to a (always non-constant) lhs variable *)
489
  type_subtyping_arg env in_main true eq.eq_rhs ty_lhs;
489
  let tins = type_list_of_type ty_lhs in
490
  let args = expr_list_of_expr eq.eq_rhs in
491
  List.iter2 (type_subtyping_arg env in_main false) args tins;
490 492
  undefined_vars
491 493

  
492 494

  

Also available in: Unified diff