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 {
1287
1287
else parents
1288
1288
}
1289
1289
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
+
1290
1294
// ----- primitive value class machinery ------------------------------------------
1291
1295
1292
1296
/** 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 {
735
735
case Ident (name : SimpleName )
736
736
if ! name.exists(isOperatorPart) &&
737
737
! app.symbol.hasAnnotation(defn.InfixAnnot ) &&
738
+ ! defn.isInfix(app.symbol) &&
738
739
! app.symbol.maybeOwner.is(Scala2x ) &&
739
740
! infixOKSinceFollowedBy(tree.right) &&
740
741
ctx.settings.strict.value =>
You can’t perform that action at this time.
0 commit comments