summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/tools/nsc/util/SourceFile.scala4
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);