|
@@ -380,14 +380,13 @@ let rec type_inline ctx cf f ethis params tret config p force =
|
|
|
| _ -> try
|
|
|
type_eq EqStrict etype tret;
|
|
|
e
|
|
|
- with Unify_error _ ->
|
|
|
+ with Unify_error _ when (match ctx.com.platform with Cpp -> true | Flash when Common.defined ctx.com Define.As3 -> true | _ -> false) ->
|
|
|
(* try to detect upcasts: in that case we may use a safe cast *)
|
|
|
Type.unify tret etype;
|
|
|
let ct = match follow tret with
|
|
|
| TInst(c,_) -> Some (TClassDecl c)
|
|
|
| _ -> None
|
|
|
in
|
|
|
- add_feature ctx.com "typed_cast";
|
|
|
mk (TCast (e,ct)) tret e.epos)
|
|
|
with Unify_error _ ->
|
|
|
mk (TCast (e,None)) tret e.epos)
|