diff options
author | Sean McDirmid <sean.mcdirmid@gmail.com> | 2005-11-16 15:36:11 +0000 |
---|---|---|
committer | Sean McDirmid <sean.mcdirmid@gmail.com> | 2005-11-16 15:36:11 +0000 |
commit | 19866718999792383b6b2dfce19b236fd2a591ed (patch) | |
tree | f60d31f3ae85f625a1b97e3389e7c44d1c66d47b | |
parent | f89520449ebeef250e9c4f86efa1118a6de7c0bb (diff) | |
download | scala-19866718999792383b6b2dfce19b236fd2a591ed.tar.gz scala-19866718999792383b6b2dfce19b236fd2a591ed.tar.bz2 scala-19866718999792383b6b2dfce19b236fd2a591ed.zip |
Also need this file to fix bug #487
-rw-r--r-- | sources/scala/tools/nsc/util/SourceFile.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/scala/tools/nsc/util/SourceFile.scala b/sources/scala/tools/nsc/util/SourceFile.scala index 28844d2734..be9cbbe4a2 100644 --- a/sources/scala/tools/nsc/util/SourceFile.scala +++ b/sources/scala/tools/nsc/util/SourceFile.scala @@ -59,8 +59,8 @@ class SourceFile(_file : AbstractFile, _content : Array[Char]) { } def find(toFind : Int, isIndex : Boolean) : Int = { - if (!isIndex && toFind == Position.NOPOS ) return Position.NOLINE - 1; // 1 will be added - if ( isIndex && toFind == Position.NOLINE) return Position.NOPOS; + if (!isIndex) assert(toFind != Position.NOPOS); + if ( isIndex) assert(toFind > Position.NOLINE - Position.FIRSTLINE); if (!isIndex && (toFind >= content.length)) throw new Error(toFind + " not valid offset in " + file.getName() + ":" + content.length); |