see #7603
@@ -134,7 +134,8 @@ let maybe_type_against_enum ctx f with_type iscall p =
| AKExpr e ->
begin match follow e.etype with
| TFun(_,t') when is_enum ->
- unify ctx t' t e.epos;
+ (* TODO: this is a dodge for #7603 *)
+ (try Type.unify t' t with Unify_error _ -> ());
AKExpr e
| _ ->
if iscall then
@@ -0,0 +1,18 @@
+package unit.issues;
+
+private abstract Foo(String) {
+ @:from static public function from(bar: Bar):Foo {
+ return cast bar.getName();
+ }
+}
+private enum Bar {
+ A(v: Int);
+ B;
+class Issue7603 extends unit.Test {
+ function test() {
+ var bar:Foo = A(200);