File tree Expand file tree Collapse file tree 3 files changed +25
-5
lines changed
tests/unit/src/unit/issues Expand file tree Collapse file tree 3 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 99 all : fixed subtypes in `expr is Module.SubType` expressions (#10174)
1010 all : fixed typing chains of calls with constrained type params (#10198)
1111 all : fixed mixed constraints of anonymous structures and other types (#10162)
12+ all : fixed operator overloading for enum abstracts (#10173)
1213 hl : fixed debugging of `catch` blocks (#10109)
1314 jvm : fixed manifest generation for cases with a lot of jar libraries (#10157)
1415 js : fixed extending extern classes for es5 (#10192)
Original file line number Diff line number Diff line change @@ -108,11 +108,7 @@ let maybe_type_against_enum ctx f with_type iscall p =
108108 (try Type. unify t' t with Unify_error _ -> () );
109109 AKExpr e
110110 | _ ->
111- if iscall then
112- AKExpr e
113- else begin
114- AKExpr (AbstractCast. cast_or_unify ctx t e e.epos)
115- end
111+ AKExpr e
116112 end
117113 | _ -> e (* ??? *)
118114 end
Original file line number Diff line number Diff line change 1+ package unit .issues ;
2+
3+ class Issue10173 extends Test {
4+ function test () {
5+ var foo : Foo = Bar ;
6+ var i = 9999 ;
7+ t (foo == i );
8+ foo = Baz ;
9+ f (foo == i );
10+ }
11+ }
12+
13+ private enum abstract Foo (Int ) to Int {
14+ var Bar ;
15+ var Baz ;
16+
17+ @:op (A == B ) public static function eqInt (lhs : Foo , rhs : Int ): Bool {
18+ return switch lhs {
19+ case Bar : true ;
20+ case Baz : false ;
21+ }
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments