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 @@ -1285,6 +1285,10 @@ class Definitions {
12851285 else parents
12861286 }
12871287
1288+ /** Is synthesized symbol with alphanumeric name allowed to be used as an infix operator? */
1289+ def isInfix (sym : Symbol )(implicit ctx : Context ): Boolean =
1290+ (sym eq Object_eq ) || (sym eq Object_ne )
1291+
12881292 // ----- primitive value class machinery ------------------------------------------
12891293
12901294 /** This class would also be obviated by the implicit function type design */
Original file line number Diff line number Diff line change @@ -682,6 +682,7 @@ trait Checking {
682682 case Ident (name : SimpleName )
683683 if ! name.exists(isOperatorPart) &&
684684 ! app.symbol.hasAnnotation(defn.InfixAnnot ) &&
685+ ! defn.isInfix(app.symbol) &&
685686 ! app.symbol.maybeOwner.is(Scala2x ) &&
686687 ! infixOKSinceFollowedBy(tree.right) &&
687688 ctx.settings.strict.value =>
You can’t perform that action at this time.
0 commit comments