closes #6609
@@ -296,7 +296,6 @@ module Pattern = struct
let v = add_local s p in
PatVariable v
| ECall(e1,el) ->
- let t = tfun (List.map (fun _ -> mk_mono()) el) t in
let e1 = type_expr ctx e1 (WithType t) in
begin match e1.eexpr,follow e1.etype with
| TField(_, FEnum(en,ef)),TFun(_,TEnum(_,tl)) ->
@@ -4104,9 +4104,6 @@ and maybe_type_against_enum ctx f with_type p =
loop (t :: stack) t2
| _ -> raise Exit
end
- (* We might type against an enum constructor. *)
- | TFun(_,tr) ->
- loop stack tr
| _ ->
raise Exit
in
@@ -0,0 +1,17 @@
+package unit.issues;
+
+private enum MyEnum {
+ MyEnumConstructor(t:String -> MyEnum);
+}
+private abstract A(String -> MyEnum) to String -> MyEnum {
+ public function new(f) {
+ this = f;
+ }
+class Issue6609 extends unit.Test {
+ function test() {
+ MyEnumConstructor(new A(null));