File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -1278,6 +1278,10 @@ class Definitions {
12781278 if (isTupleClass(cls) || cls == UnitClass ) parents :+ syntheticParent(tparams) else parents
12791279 }
12801280
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+
12811285 // ----- primitive value class machinery ------------------------------------------
12821286
12831287 /** 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 {
675675 case Ident (name : SimpleName )
676676 if ! name.exists(isOperatorPart) &&
677677 ! app.symbol.hasAnnotation(defn.InfixAnnot ) &&
678+ ! defn.isInfix(app.symbol) &&
678679 ! app.symbol.maybeOwner.is(Scala2x ) &&
679680 ! infixOKSinceFollowedBy(tree.right) &&
680681 ctx.settings.strict.value =>
You can’t perform that action at this time.
0 commit comments