From 33118594a3f4f5c2336c1ca5994c14f30b3cf676 Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Thu, 26 Jul 2012 16:01:57 +0200 Subject: `ScriptSourceFile` should not hard-code `OffsetPosition`. The presentation compiler should support script source files as well, but it needs range positions. This commit fixes an oversight when `RangePosition` was introduced. --- src/reflect/scala/reflect/internal/util/SourceFile.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reflect/scala/reflect/internal/util/SourceFile.scala b/src/reflect/scala/reflect/internal/util/SourceFile.scala index df4a3336c3..f8d656ad34 100644 --- a/src/reflect/scala/reflect/internal/util/SourceFile.scala +++ b/src/reflect/scala/reflect/internal/util/SourceFile.scala @@ -98,7 +98,7 @@ class ScriptSourceFile(underlying: BatchSourceFile, content: Array[Char], overri override def positionInUltimateSource(pos: Position) = if (!pos.isDefined) super.positionInUltimateSource(pos) - else new OffsetPosition(underlying, pos.point + start) + else pos.withSource(underlying, start) } /** a file whose contents do not change over time */ -- cgit v1.2.3