Skip to content

Commit 84d68d5

Browse files
authored
Merge pull request #5922 from dotty-staging/fix-#5915
Fix #5915: Implied classes need wrapper object
2 parents fa4daf1 + 4601a98 commit 84d68d5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ object desugar {
10071007
case _: ValDef | _: PatDef | _: DefDef => true
10081008
case stat: ModuleDef =>
10091009
stat.mods.is(ImplicitOrImplied) || opaqueNames.contains(stat.name.stripModuleClassSuffix.toTypeName)
1010-
case stat: TypeDef => !stat.isClassDef || stat.mods.is(Implicit)
1010+
case stat: TypeDef => !stat.isClassDef || stat.mods.is(ImplicitOrImplied)
10111011
case _ => false
10121012
}
10131013
val (nestedStats, topStats) = pdef.stats.partition(needsObject)

tests/pos/i5915.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
trait RunDSL
2+
3+
val rdsl = new RunDSL {}
4+
5+
implied RunNNFExpr[B] for RunDSL = rdsl
6+
7+
implied RunNNFImpl[B] for RunDSL {
8+
//override def runDSL(b: NNF[B]): B = b.terminal
9+
}

0 commit comments

Comments
 (0)