We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ed64113 commit 535368fCopy full SHA for 535368f
compiler/src/dotty/tools/dotc/typer/Checking.scala
@@ -555,7 +555,7 @@ object Checking {
555
fail(CannotHaveSameNameAs(sym, cls, CannotHaveSameNameAs.CannotBeOverridden))
556
sym.setFlag(Private) // break the overriding relationship by making sym Private
557
}
558
- if sym.isWrappedToplevelDef && !sym.isType then fail(ToplevelDefCantBeInfix(sym))
+ if sym.isWrappedToplevelDef && !sym.isType && sym.flags.is(Infix) then fail(ToplevelDefCantBeInfix(sym))
559
checkApplicable(Erased,
560
!sym.isOneOf(MutableOrLazy, butNot = Given) && !sym.isType || sym.isClass)
561
checkCombination(Final, Open)
0 commit comments