Skip to content

Commit b06546f

Browse files
committed
make NoSymbol.associatedFile return NoSource.file
Otherwise, associatedFile calls topLevelClass, which fails for NoSymbol.
1 parent b253252 commit b06546f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import Denotations.{ Denotation, SingleDenotation, MultiDenotation }
2525
import collection.mutable
2626
import io.AbstractFile
2727
import language.implicitConversions
28-
import util.DotClass
28+
import util.{NoSource, DotClass}
2929

3030
/** Creation methods for symbols */
3131
trait Symbols { this: Context =>
@@ -515,6 +515,8 @@ object Symbols {
515515

516516
object NoSymbol extends Symbol(NoCoord) {
517517
denot = NoDenotation
518+
519+
override def associatedFile(implicit ctx: Context): AbstractFile = NoSource.file
518520
}
519521

520522
implicit class Copier[N <: Name](sym: Symbol { type ThisName = N })(implicit ctx: Context) {

0 commit comments

Comments
 (0)