From f45ea36183741823c69ee47ef252a68b9dce5dd7 Mon Sep 17 00:00:00 2001 From: Geoffrey Washburn Date: Fri, 8 Feb 2008 14:46:32 +0000 Subject: Fixed #368: - added assertions to cause failure earlier - added test case - use BatchSourceFile length (characters) rather than file length (bytes) --- src/compiler/scala/tools/nsc/ScriptRunner.scala | 6 ++++-- src/compiler/scala/tools/nsc/util/SourceFile.scala | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/ScriptRunner.scala b/src/compiler/scala/tools/nsc/ScriptRunner.scala index 78a63b2b23..d8ea282122 100644 --- a/src/compiler/scala/tools/nsc/ScriptRunner.scala +++ b/src/compiler/scala/tools/nsc/ScriptRunner.scala @@ -188,10 +188,12 @@ object ScriptRunner { val middle = { val f = new File(filename) + val bsf = getSourceFile(new PlainFile(f)).asInstanceOf[BatchSourceFile] new SourceFileFragment( - getSourceFile(new PlainFile(f)).asInstanceOf[BatchSourceFile], + bsf, headerLength(filename), - f.length.asInstanceOf[Int]) + bsf.length) +// f.length.asInstanceOf[Int]) } val end = new BatchSourceFile("