@@ -108,11 +108,7 @@ let maybe_type_against_enum ctx f with_type iscall p =
(try Type.unify t' t with Unify_error _ -> ());
AKExpr e
| _ ->
- if iscall then
- AKExpr e
- else begin
- AKExpr (AbstractCast.cast_or_unify ctx t e e.epos)
- end
+ AKExpr e
end
| _ -> e (* ??? *)
@@ -0,0 +1,23 @@
+package unit.issues;
+
+class Issue10173 extends Test {
+ function test() {
+ var foo:Foo = Bar;
+ var i = 9999;
+ t(foo == i);
+ foo = Baz;
+ f(foo == i);
+ }
+}
+private enum abstract Foo(Int) to Int {
+ var Bar;
+ var Baz;
+ @:op(A == B) public static function eqInt(lhs:Foo, rhs:Int):Bool {
+ return switch lhs {
+ case Bar: true;
+ case Baz: false;