Skip to content

Commit 4d992ae

Browse files
committed
Address review comments
1 parent 1122b62 commit 4d992ae

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,8 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
6868
private[this] var myUnits: List[CompilationUnit] = _
6969
private[this] var myUnitsCached: List[CompilationUnit] = _
7070
private[this] var myFiles: Set[AbstractFile] = _
71-
72-
/** Units that are added because of source completers but that are not
73-
* compiled in current run.
74-
*/
75-
val lateUnits = mutable.ListBuffer[CompilationUnit]()
76-
var lateFiles = mutable.Set[AbstractFile]()
71+
private[this] val myLateUnits = mutable.ListBuffer[CompilationUnit]()
72+
private[this] var myLateFiles = mutable.Set[AbstractFile]()
7773

7874
/** The compilation units currently being compiled, this may return different
7975
* results over time.
@@ -95,6 +91,12 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
9591
myFiles
9692
}
9793

94+
/** Units that are added from source completers but that are not compiled in current run. */
95+
def lateUnits: List[CompilationUnit] = myLateUnits.toList
96+
97+
/** The source files of all late units, as a set */
98+
def lateFiles: collection.Set[AbstractFile] = myLateFiles
99+
98100
def getSource(fileName: String): SourceFile = {
99101
val f = new PlainFile(io.Path(fileName))
100102
if (f.isDirectory) {
@@ -184,8 +186,8 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
184186
def enterRoots(file: AbstractFile)(implicit ctx: Context): Unit =
185187
if (!files.contains(file) && !lateFiles.contains(file)) {
186188
val unit = new CompilationUnit(getSource(file.path))
187-
lateUnits += unit
188-
lateFiles += file
189+
myLateUnits += unit
190+
myLateFiles += file
189191
enterRoots(unit)(runContext.fresh.setCompilationUnit(unit))
190192
}
191193

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class SymbolLoaders {
133133
def checkPathMatches(path: List[TermName], what: String, tree: MemberDef): Boolean = {
134134
val ok = filePath == path
135135
if (!ok)
136-
ctx.warning(i"""$what ${tree.name} is in wrong directory.
136+
ctx.warning(i"""$what ${tree.name} is in the wrong directory.
137137
|It was declared to be in package ${path.reverse.mkString(".")}
138138
|But it is found in directory ${filePath.reverse.mkString(File.separator)}""",
139139
tree.pos)

0 commit comments

Comments
 (0)