diff options
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/util/SourceFile.scala | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/util/SourceFile.scala b/src/compiler/scala/tools/nsc/util/SourceFile.scala index 9f5e094472..6d783e36b3 100644 --- a/src/compiler/scala/tools/nsc/util/SourceFile.scala +++ b/src/compiler/scala/tools/nsc/util/SourceFile.scala @@ -66,8 +66,14 @@ class BatchSourceFile(val file : AbstractFile, _content : Array[Char]) extends S } override def hashCode = file.hashCode - val content = _content - override val length = content.length + var content = _content + var length = _content.length + + def setContent(newContent : Array[Char]) { + content = newContent + length = newContent.length + } + // in SourceFileFragments, these are overridden to compensate during offset calculation // Invariant: length + start = underlyingLength def underlyingLength = length |