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 @@ -1285,6 +1285,10 @@ class Definitions {
1285
1285
else parents
1286
1286
}
1287
1287
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
+
1288
1292
// ----- primitive value class machinery ------------------------------------------
1289
1293
1290
1294
/** 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 {
682
682
case Ident (name : SimpleName )
683
683
if ! name.exists(isOperatorPart) &&
684
684
! app.symbol.hasAnnotation(defn.InfixAnnot ) &&
685
+ ! defn.isInfix(app.symbol) &&
685
686
! app.symbol.maybeOwner.is(Scala2x ) &&
686
687
! infixOKSinceFollowedBy(tree.right) &&
687
688
ctx.settings.strict.value =>
You can’t perform that action at this time.
0 commit comments