Skip to content

Commit 234f3c1

Browse files
fix compiling GenBCode.scala
companion for a module should always be a class. this commit adds a check when looking for the companion symbol.
1 parent e6706d1 commit 234f3c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ object SymDenotations {
885885
*/
886886
private def companionNamed(name: TypeName)(implicit ctx: Context): Symbol =
887887
if (owner.isClass)
888-
owner.info.decl(name).suchThat(_.isCoDefinedWith(symbol)).symbol
888+
owner.info.decl(name).suchThat(x => x.isCoDefinedWith(symbol) && x.isClass && x.symbol.isClass).symbol
889889
else if (!owner.exists || ctx.compilationUnit == null)
890890
NoSymbol
891891
else if (!ctx.compilationUnit.tpdTree.isEmpty)

0 commit comments

Comments
 (0)