Project

General

Profile

Revision 0b78e972 src/typing.ml

View differences:

src/typing.ml
764 764
let uneval_prog_generics prog =
765 765
 List.iter uneval_top_generics prog
766 766

  
767
let rec get_imported_node decls id =
768
  match decls with
769
  | [] -> assert false
770
  | decl::q ->
771
     (match decl.top_decl_desc with
772
      | ImportedNode nd when id = nd.nodei_id -> decl
773
      | _ -> get_imported_node q id)
774

  
767 775
let check_env_compat header declared computed = 
768 776
  uneval_prog_generics header;
769 777
  Env.iter declared (fun k decl_type_k -> 
770
    let computed_t = instantiate (ref []) (ref []) (Env.lookup_value computed k) in
778
    let computed_t = instantiate (ref []) (ref []) 
779
				 (try Env.lookup_value computed k
780
				  with Not_found ->
781
				    let loc = (get_imported_node header k).top_decl_loc in 
782
				    raise (Error (loc, Declared_but_undefined k))) in
771 783
    (*Types.print_ty Format.std_formatter decl_type_k;
772 784
    Types.print_ty Format.std_formatter computed_t;*)
773 785
    try_semi_unify decl_type_k computed_t Location.dummy_loc
774
  ) 
786
		    )
775 787

  
776 788
(* Local Variables: *)
777 789
(* compile-command:"make -C .." *)

Also available in: Unified diff