Skip to content

Commit 81ac68f

Browse files
committed
Check in companionPath doesn't accept case objects
1 parent f00fa72 commit 81ac68f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ trait Implicits { self: Typer =>
909909
/** A path referencing the companion of class type `clsType` */
910910
private def companionPath(clsType: Type, span: Span)(implicit ctx: Context) = {
911911
val ref = pathFor(clsType.companionRef)
912-
assert(ref.symbol.is(Module) && ref.symbol.companionClass == clsType.classSymbol)
912+
assert(ref.symbol.is(Module) && (clsType.classSymbol.is(ModuleClass) || (ref.symbol.companionClass == clsType.classSymbol)))
913913
ref.withSpan(span)
914914
}
915915

0 commit comments

Comments
 (0)