File tree 2 files changed +1
-9
lines changed
compiler/src/dotty/tools/dotc
2 files changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -1510,13 +1510,6 @@ import transform.SymUtils._
1510
1510
def explain = " "
1511
1511
}
1512
1512
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
-
1520
1513
class TypesAndTraitsCantBeImplicit ()(using Context )
1521
1514
extends SyntaxMsg (TypesAndTraitsCantBeImplicitID ) {
1522
1515
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 {
473
473
if sym.isInlineMethod && ! sym.is(Deferred ) && sym.allOverriddenSymbols.nonEmpty then
474
474
checkInlineOverrideParameters(sym)
475
475
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 " )
478
477
if sym.isType && (! sym.isClass || sym.is(Trait )) then
479
478
fail(TypesAndTraitsCantBeImplicit ())
480
479
}
You can’t perform that action at this time.
0 commit comments