Skip to content

Commit 829acf0

Browse files
committed
Address other review comments
1 parent 360510c commit 829acf0

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,9 +655,6 @@ object Symbols {
655655

656656
/** The position of this symbol, or NoSpan if the symbol was not loaded
657657
* from source or from TASTY. This is always a zero-extent position.
658-
*
659-
* NOTE: If the symbol was not loaded from the current compilation unit,
660-
* the implicit conversion `sourcePos` will return the wrong result, careful!
661658
*/
662659
final def span: Span = if (coord.isSpan) coord.toSpan else NoSpan
663660

compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ Standard Section: "Positions" Assoc*
228228
// offset_Deltas give difference of start/end offset wrt to the
229229
// same offset in the previously recorded node (or 0 for the first recorded node)
230230
Delta = Int // Difference between consecutive offsets,
231-
SOURCE = 4 // Impossible as header
231+
SOURCE = 4 // Impossible as header, since addr_Delta = 0 implies that we refer to the
232+
// same treeas the previous one, but then hasStartDiff = 1 implies that
233+
// the tree's range starts later than the range of itself.
232234
233235
All elements of a position section are serialized as Ints
234236

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ class SourceFile(val file: AbstractFile, computeContent: => Array[Char]) extends
190190
}
191191
}
192192
object SourceFile {
193-
implicit def eqSurce: Eq[SourceFile, SourceFile] = Eq
193+
implicit def eqSource: Eq[SourceFile, SourceFile] = Eq
194194

195195
implicit def fromContext(implicit ctx: Context): SourceFile = ctx.source
196196

@@ -202,6 +202,8 @@ object SourceFile {
202202

203203
private final val ChunkSizeLog = 10
204204
private final val ChunkSize = 1 << ChunkSizeLog
205+
206+
// These two vars are sharable because they're only used in the synchronized block in newChunk
205207
@sharable private var chunks: Int = 0
206208
@sharable private var sourceOfChunk: Array[SourceFile] = new Array[SourceFile](2000)
207209
}

0 commit comments

Comments
 (0)