let rec getfield_struct s1 s2 env = 
  let t_field = gettype_struct s1 s2 env in
  match env with
      (TyStructDef (s,lst,_))::rest when (s = s1) -> indexof (s2,t_field) lst 0
    | _::rest -> getfield_struct s1 s2 rest
    | [] -> raise Not_found