Skip to content

Commit

Permalink
move type_of_module_type to type.ml because it is very useful
Browse files Browse the repository at this point in the history
  • Loading branch information
Simn committed Jan 27, 2015
1 parent de544d9 commit f87cfb0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 6 additions & 0 deletions type.ml
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,12 @@ let concat e1 e2 =

let is_closed a = !(a.a_status) <> Opened

let type_of_module_type = function
| TClassDecl c -> TInst (c,List.map snd c.cl_params)
| TEnumDecl e -> TEnum (e,List.map snd e.e_params)
| TTypeDecl t -> TType (t,List.map snd t.t_params)
| TAbstractDecl a -> TAbstract (a,List.map snd a.a_params)

(* ======= Field utility ======= *)

let field_name f =
Expand Down
8 changes: 1 addition & 7 deletions typer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -817,12 +817,6 @@ let fast_enum_field e ef p =
let et = mk (TTypeExpr (TEnumDecl e)) (TAnon { a_fields = PMap.empty; a_status = ref (EnumStatics e) }) p in
TField (et,FEnum (e,ef))

let type_of_module_type = function
| TClassDecl c -> TInst (c,List.map snd c.cl_params)
| TEnumDecl e -> TEnum (e,List.map snd e.e_params)
| TTypeDecl t -> TType (t,List.map snd t.t_params)
| TAbstractDecl a -> TAbstract (a,List.map snd a.a_params)

let rec type_module_type ctx t tparams p =
match t with
| TClassDecl c ->
Expand Down Expand Up @@ -4915,4 +4909,4 @@ get_constructor_ref := get_constructor;
cast_or_unify_ref := Codegen.AbstractCast.cast_or_unify_raise;
type_module_type_ref := type_module_type;
find_array_access_raise_ref := Codegen.AbstractCast.find_array_access_raise;
build_call_ref := build_call
build_call_ref := build_call

0 comments on commit f87cfb0

Please sign in to comment.