Permalink
Browse files

deal with @:coreType abstract recursion in various places

  • Loading branch information...
1 parent a929a69 commit aadc4a4157e18c0599dbbc4cca38e0f909f85207 @Simn Simn committed Feb 19, 2014
Showing with 8 additions and 5 deletions.
  1. +6 −3 dce.ml
  2. +1 −1 genswf9.ml
  3. +1 −1 matcher.ml
View
9 dce.ml
@@ -221,8 +221,11 @@ let rec to_string dce t = match t with
dce.ts_stack <- t :: dce.ts_stack;
to_string dce (apply_params tt.t_types tl tt.t_type)
end
- | TAbstract(a,tl) ->
- to_string dce (Codegen.Abstract.get_underlying_type a tl)
+ | TAbstract({a_impl = Some c} as a,tl) ->
+ if Meta.has Meta.CoreType a.a_meta then
+ field dce c "toString" false
+ else
+ to_string dce (Codegen.Abstract.get_underlying_type a tl)
| TMono r ->
(match !r with
| Some t -> to_string dce t
@@ -234,7 +237,7 @@ let rec to_string dce t = match t with
()
else
to_string dce t
- | TEnum _ | TFun _ | TAnon _ ->
+ | TEnum _ | TFun _ | TAnon _ | TAbstract({a_impl = None},_) ->
(* if we to_string these it does not imply that we need all its sub-types *)
()
View
@@ -205,7 +205,7 @@ let rec follow_basic t =
t
| TType (t,tl) ->
follow_basic (apply_params t.t_types tl t.t_type)
- | TAbstract (a,pl) when a.a_impl <> None ->
+ | TAbstract (a,pl) when not (Meta.has Meta.CoreType a.a_meta) ->
follow_basic (apply_params a.a_types pl a.a_this)
| _ -> t
View
@@ -789,7 +789,7 @@ let rec all_ctors mctx t =
| _ -> ()
) c.cl_ordered_statics;
h,false
- | TAbstract(a,pl) -> all_ctors mctx (Codegen.Abstract.get_underlying_type a pl)
+ | TAbstract(a,pl) when not (Meta.has Meta.CoreType a.a_meta) -> all_ctors mctx (Codegen.Abstract.get_underlying_type a pl)
| TInst({cl_path=[],"String"},_)
| TInst({cl_path=[],"Array"},_) ->
h,true

0 comments on commit aadc4a4

Please sign in to comment.