Skip to content

Commit 698b61b

Browse files
committed
Remove SourceFile dependency on TermName
1 parent aa1979f commit 698b61b

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

compiler/src/dotty/tools/dotc/core/Contexts.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ object Contexts {
239239
}
240240

241241
/** Sourcefile with given path name, memoized */
242-
def getSource(path: SourceFile.PathName): SourceFile = base.sourceNamed.get(path) match {
242+
def getSource(path: TermName): SourceFile = base.sourceNamed.get(path) match {
243243
case Some(source) =>
244244
source
245245
case None =>
@@ -685,7 +685,7 @@ object Contexts {
685685

686686
/** Sources that were loaded */
687687
val sources: mutable.HashMap[AbstractFile, SourceFile] = new mutable.HashMap[AbstractFile, SourceFile]
688-
val sourceNamed: mutable.HashMap[SourceFile.PathName, SourceFile] = new mutable.HashMap[SourceFile.PathName, SourceFile]
688+
val sourceNamed: mutable.HashMap[TermName, SourceFile] = new mutable.HashMap[TermName, SourceFile]
689689

690690
// Types state
691691
/** A table for hash consing unique types */

compiler/src/dotty/tools/dotc/util/SourceFile.scala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ import java.io.IOException
99
import scala.internal.Chars._
1010
import Spans._
1111
import scala.io.Codec
12-
import core.Names.TermName
1312
import core.Contexts.Context
1413
import scala.annotation.internal.sharable
15-
import core.Decorators.PreNamedString
1614
import java.util.concurrent.atomic.AtomicInteger
1715
import scala.collection.mutable
1816

@@ -200,8 +198,6 @@ object SourceFile {
200198

201199
implicit def fromContext(implicit ctx: Context): SourceFile = ctx.source
202200

203-
type PathName = TermName
204-
205201
def fromId(id: Int): SourceFile = sourceOfChunk(id >> ChunkSizeLog)
206202

207203
def virtual(name: String, content: String) = new SourceFile(new VirtualFile(name, content.getBytes), scala.io.Codec.UTF8)

0 commit comments

Comments
 (0)