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 @@ -1287,6 +1287,10 @@ class Definitions {
12871287 else parents
12881288 }
12891289
1290+ /** Is synthesized symbol with alphanumeric name allowed to be used as an infix operator? */
1291+ def isInfix (sym : Symbol )(implicit ctx : Context ): Boolean =
1292+ (sym eq Object_eq ) || (sym eq Object_ne )
1293+
12901294 // ----- primitive value class machinery ------------------------------------------
12911295
12921296 /** This class would also be obviated by the implicit function type design */
Original file line number Diff line number Diff line change @@ -735,6 +735,7 @@ trait Checking {
735735 case Ident (name : SimpleName )
736736 if ! name.exists(isOperatorPart) &&
737737 ! app.symbol.hasAnnotation(defn.InfixAnnot ) &&
738+ ! defn.isInfix(app.symbol) &&
738739 ! app.symbol.maybeOwner.is(Scala2x ) &&
739740 ! infixOKSinceFollowedBy(tree.right) &&
740741 ctx.settings.strict.value =>
You can’t perform that action at this time.
0 commit comments