Skip to content

Commit b492fd8

Browse files
committed
Remove ContextBase.sourceNamed
1 parent 32db4f9 commit b492fd8

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

compiler/src/dotty/tools/dotc/Run.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
218218
if (!files.contains(file) && !lateFiles.contains(file)) {
219219
lateFiles += file
220220

221-
val unit = CompilationUnit(ctx.getSource(file.path))
221+
val unit = CompilationUnit(ctx.getSource(file))
222222
val unitCtx = runContext.fresh
223223
.setCompilationUnit(unit)
224224
.withRootImports

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,9 @@ object Contexts {
267267
}
268268

269269
/** SourceFile with given path name, memoized */
270-
def getSource(path: TermName): SourceFile = base.sourceNamed.get(path) match
271-
case Some(source) =>
272-
source
273-
case None =>
274-
getFile(path) match
275-
case NoAbstractFile => NoSource
276-
case file => getSource(file)
270+
def getSource(path: TermName): SourceFile = getFile(path) match
271+
case NoAbstractFile => NoSource
272+
case file => getSource(file)
277273

278274
/** SourceFile with given path, memoized */
279275
def getSource(path: String): SourceFile = getSource(path.toTermName)
@@ -855,7 +851,6 @@ object Contexts {
855851

856852
/** Sources and Files that were loaded */
857853
val sources: util.HashMap[AbstractFile, SourceFile] = util.HashMap[AbstractFile, SourceFile]()
858-
val sourceNamed: util.HashMap[TermName, SourceFile] = util.HashMap[TermName, SourceFile]()
859854
val files: util.HashMap[TermName, AbstractFile] = util.HashMap()
860855

861856
// Types state
@@ -940,7 +935,6 @@ object Contexts {
940935
emptyWildcardBounds = null
941936
errorTypeMsg.clear()
942937
sources.clear()
943-
sourceNamed.clear()
944938
files.clear()
945939
comparers.clear() // forces re-evaluation of top and bottom classes in TypeComparer
946940

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ object SymbolLoaders {
173173
Nil)
174174
}
175175

176-
val unit = CompilationUnit(ctx.getSource(src.path))
176+
val unit = CompilationUnit(ctx.getSource(src))
177177
enterScanned(unit)(using ctx.fresh.setCompilationUnit(unit))
178178

179179
/** The package objects of scala and scala.reflect should always

0 commit comments

Comments
 (0)