|
@@ -3193,6 +3193,12 @@ and type_call ctx e el (with_type:with_type) p =
|
|
|
if platform ctx.com Js && el = [] && has_dce ctx.com then
|
|
|
let e = type_expr ctx e Value in
|
|
|
let infos = type_expr ctx infos Value in
|
|
|
+ let e = match follow e.etype with
|
|
|
+ | TAbstract({a_impl = Some c},_) when PMap.mem "toString" c.cl_statics ->
|
|
|
+ call_to_string ctx c e
|
|
|
+ | _ ->
|
|
|
+ e
|
|
|
+ in
|
|
|
mk (TCall (mk (TLocal (alloc_var "`trace" t_dynamic)) t_dynamic p,[e;infos])) ctx.t.tvoid p
|
|
|
else
|
|
|
let me = Meta.ToString,[],pos e in
|