File tree 2 files changed +5
-0
lines changed
compiler/src/dotty/tools/dotc
2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -1278,6 +1278,10 @@ class Definitions {
1278
1278
if (isTupleClass(cls) || cls == UnitClass ) parents :+ syntheticParent(tparams) else parents
1279
1279
}
1280
1280
1281
+ /** Is synthesized symbol with alphanumeric name allowed to be used as an infix operator? */
1282
+ def isInfix (sym : Symbol )(implicit ctx : Context ): Boolean =
1283
+ (sym eq Object_eq ) || (sym eq Object_ne )
1284
+
1281
1285
// ----- primitive value class machinery ------------------------------------------
1282
1286
1283
1287
/** This class would also be obviated by the implicit function type design */
Original file line number Diff line number Diff line change @@ -675,6 +675,7 @@ trait Checking {
675
675
case Ident (name : SimpleName )
676
676
if ! name.exists(isOperatorPart) &&
677
677
! app.symbol.hasAnnotation(defn.InfixAnnot ) &&
678
+ ! defn.isInfix(app.symbol) &&
678
679
! app.symbol.maybeOwner.is(Scala2x ) &&
679
680
! infixOKSinceFollowedBy(tree.right) &&
680
681
ctx.settings.strict.value =>
You can’t perform that action at this time.
0 commit comments