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 91515d6 commit 1dd1af8Copy full SHA for 1dd1af8
compiler/src/dotty/tools/dotc/typer/Checking.scala
@@ -561,7 +561,7 @@ object Checking {
561
fail(CannotHaveSameNameAs(sym, cls, CannotHaveSameNameAs.CannotBeOverridden))
562
sym.setFlag(Private) // break the overriding relationship by making sym Private
563
}
564
- if sym.isWrappedToplevelDef && !sym.isType then fail(ToplevelDefCantBeInfix(sym))
+ if sym.isWrappedToplevelDef && !sym.isType && sym.flags.is(Infix) then fail(ToplevelDefCantBeInfix(sym))
565
checkApplicable(Erased,
566
!sym.isOneOf(MutableOrLazy, butNot = Given) && !sym.isType || sym.isClass)
567
checkCombination(Final, Open)
0 commit comments