File tree Expand file tree Collapse file tree 2 files changed +1
-9
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -1510,13 +1510,6 @@ import transform.SymUtils._
15101510 def explain = " "
15111511 }
15121512
1513- class TopLevelCantBeImplicit (sym : Symbol )(
1514- implicit ctx : Context )
1515- extends SyntaxMsg (TopLevelCantBeImplicitID ) {
1516- def msg = em """ ${hl(" implicit" )} modifier cannot be used for top-level definitions """
1517- def explain = " "
1518- }
1519-
15201513 class TypesAndTraitsCantBeImplicit ()(using Context )
15211514 extends SyntaxMsg (TypesAndTraitsCantBeImplicitID ) {
15221515 def msg = em """ ${hl(" implicit" )} modifier cannot be used for types or traits """
Original file line number Diff line number Diff line change @@ -473,8 +473,7 @@ object Checking {
473473 if sym.isInlineMethod && ! sym.is(Deferred ) && sym.allOverriddenSymbols.nonEmpty then
474474 checkInlineOverrideParameters(sym)
475475 if (sym.is(Implicit )) {
476- if (sym.owner.is(Package ))
477- fail(TopLevelCantBeImplicit (sym))
476+ assert(! sym.owner.is(Package ), s " top-level implicit $sym should be wrapped by a package after typer " )
478477 if sym.isType && (! sym.isClass || sym.is(Trait )) then
479478 fail(TypesAndTraitsCantBeImplicit ())
480479 }
You can’t perform that action at this time.
0 commit comments