summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Washburn <geoffrey.washburn@epfl.ch>2008-07-02 08:05:41 +0000
committerGeoffrey Washburn <geoffrey.washburn@epfl.ch>2008-07-02 08:05:41 +0000
commit3b18a3f00475bea500309d9c4d2ad4bb6ee61abe (patch)
treee9eb669e4e59a9e59679ad79f941c8d4ac884f1c
parentd4115d48985d8d1aa76bc9a84c2f67ea8d631c60 (diff)
downloadscala-3b18a3f00475bea500309d9c4d2ad4bb6ee61abe.tar.gz
scala-3b18a3f00475bea500309d9c4d2ad4bb6ee61abe.tar.bz2
scala-3b18a3f00475bea500309d9c4d2ad4bb6ee61abe.zip
Removed pointless assertions.
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/NewScanners.scala3
-rw-r--r--src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala3
-rw-r--r--src/compiler/scala/tools/nsc/symtab/SymbolWalker.scala8
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala6
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/IdeSupport.scala13
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala1
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala2
-rw-r--r--src/compiler/scala/tools/nsc/util/CharArrayReader.scala1
-rw-r--r--src/compiler/scala/tools/nsc/util/ClassPath.scala1
-rw-r--r--src/compiler/scala/tools/nsc/util/SourceFile.scala1
10 files changed, 0 insertions, 39 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/NewScanners.scala b/src/compiler/scala/tools/nsc/ast/parser/NewScanners.scala
index 837835826e..53d7b15371 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/NewScanners.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/NewScanners.scala
@@ -135,7 +135,6 @@ trait NewScanners {
case LPAREN => RPAREN
case LBRACKET => RBRACKET
case CASE =>
- assert(true)
ARROW
case RBRACE =>
while (!sepRegions.isEmpty && sepRegions.head != RBRACE)
@@ -147,7 +146,6 @@ trait NewScanners {
sepRegions = sepRegions.tail
EMPTY
case ARROW =>
- assert(true)
EMPTY
case code @ (RPAREN|RBRACKET) =>
if (!sepRegions.isEmpty && sepRegions.head == code)
@@ -171,7 +169,6 @@ trait NewScanners {
fillNext
(current.code,next.code) match {
case (CASE,OBJECT) =>
- assert(true)
current.code = CASEOBJECT; next.code = EMPTY
case (CASE, CLASS) => current.code = CASECLASS ; next.code = EMPTY
case (SEMI, ELSE ) => currentIsNext
diff --git a/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala b/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala
index 2b5f147c67..f698e171d2 100644
--- a/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala
+++ b/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala
@@ -55,7 +55,6 @@ abstract class SymbolLoaders {
assert(root.rawInfo == this)
if (clazz != NoSymbol && !clazz.rawInfo.isInstanceOf[SymbolLoader]) {
// bail
- assert(true)
root.setInfo(ErrorType)
Console.println("ditch " + root)
return
@@ -64,14 +63,12 @@ abstract class SymbolLoaders {
val module = root.linkedModuleOfClass
assert(root.rawInfo == this)
if (module != NoSymbol && !module.rawInfo.isInstanceOf[SymbolLoader]) {
- assert(true)
root.setInfo(ErrorType)
Console.println("ditch " + root)
return
}
} else {
assert(root.isModule)
- assert(true)
}
}
try {
diff --git a/src/compiler/scala/tools/nsc/symtab/SymbolWalker.scala b/src/compiler/scala/tools/nsc/symtab/SymbolWalker.scala
index c5672ba06a..bdd06d836c 100644
--- a/src/compiler/scala/tools/nsc/symtab/SymbolWalker.scala
+++ b/src/compiler/scala/tools/nsc/symtab/SymbolWalker.scala
@@ -39,7 +39,6 @@ trait SymbolWalker {
case (t : TypeTree, tp) if tp != null && tp.typeSymbol != null && tp.typeSymbol != NoSymbol => tp.typeSymbol
case (t : TypeTree, tp) if tp != null && tp.resultType != null && tp.resultType.typeSymbol != null => tp.resultType.typeSymbol
case (t, tpe : Type) if tpe != null && (t.symbol eq NoSymbol) && t.isTerm && tpe.termSymbol != null =>
- assert(true)
tpe.termSymbol
case (t, tpe : Type) if tpe != null && (t.symbol eq NoSymbol) && tpe.typeSymbol != null =>
if (t.tpe.isInstanceOf[TypeRef]) asTypeRef.sym // XXX: looks like a bug
@@ -53,8 +52,6 @@ trait SymbolWalker {
val name = sym.name.decode.trim
if ((name startsWith id.get) || (id.get startsWith name)) true
else {
- assert(true)
- assert(true)
false
}
} else false
@@ -77,7 +74,6 @@ trait SymbolWalker {
}
}}
}
- assert(true)
t match {
case t : DefTree if t.symbol != NoSymbol =>
if (t.pos != NoPosition)
@@ -85,7 +81,6 @@ trait SymbolWalker {
if (t.symbol.isClass) {
val factory = NoSymbol // XXX: t.symbol.caseFactory
if (factory != NoSymbol) {
- assert(true)
visitor.putDef(factory, t.pos)
}
}
@@ -138,7 +133,6 @@ trait SymbolWalker {
case tree: ValOrDefDef =>
f(tree.rhs);
if (tree.tpt != null) {
- assert(true)
f(tree.tpt)
}
tree match {
@@ -172,7 +166,6 @@ trait SymbolWalker {
}
}
if (tree.tpt.tpe == null) {
- assert(true)
tree.tpt.tpe = tree.tpe
}
@@ -238,7 +231,6 @@ trait SymbolWalker {
case tree : Try => f(tree.block); fs(tree.catches); f(tree.finalizer);
case tree : Alternative => fs(tree.trees);
case tree : TypeDef =>
- assert(true)
(tree.tpe,sym) match {
case (null,sym : TypeSymbol) if (sym.rawInfo.isComplete) =>
if (tree.tparams.isEmpty) {
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index 0b2ff51fc4..fbfae15b15 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -492,12 +492,6 @@ trait Types {
else isSubType(this, that)));
if (util.Statistics.enabled)
subtypeMillis = subtypeMillis + currentTime - startTime
- if (!result && this.isInstanceOf[ExistentialType]) {
- Console.println("XXX: " + this + " " + that)
- assert(true)
- assert(true)
- }
-
result
}
diff --git a/src/compiler/scala/tools/nsc/typechecker/IdeSupport.scala b/src/compiler/scala/tools/nsc/typechecker/IdeSupport.scala
index 3f9fb4ac12..3e0f92cc9e 100644
--- a/src/compiler/scala/tools/nsc/typechecker/IdeSupport.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/IdeSupport.scala
@@ -56,7 +56,6 @@ trait IdeSupport extends Analyzer {
}
if (pause) {
assert(true)
- assert(true)
}
case _=>
}
@@ -198,8 +197,6 @@ trait IdeSupport extends Analyzer {
//Console.println("FK-ENTER: " + tree.symbol)
val sym = namer.enterInScope(tree.symbol)
if (sym != tree.symbol) {
- assert(true)
- assert(true)
Console.println("BAD: " + sym + " " + sym.id + " vs. " + tree.symbol.id)
}
import symtab.Flags._
@@ -229,7 +226,6 @@ trait IdeSupport extends Analyzer {
}
} else if (sym.hasFlag(symtab.Flags.LAZY) && sym.lazyAccessor != NoSymbol) {
if (set.get.find(sym0 => sym0 == sym.lazyAccessor).isDefined) {
- assert(true)
namer.enterInScope(sym.lazyAccessor)
}
}
@@ -256,7 +252,6 @@ trait IdeSupport extends Analyzer {
val use = useTrees
if (makeNoChanges) {}
else if (use.isEmpty || use.last.symbol != NoSymbol) {
- assert(true)
return fakeUpdate(use) // already named
}
@@ -283,7 +278,6 @@ trait IdeSupport extends Analyzer {
var e = tree.symbol.owner.info.decls.lookupEntry(tree.symbol.name.toTermName)
if (e != null) e.sym.pos match { // retype the object if its in the scope.
case pos : TrackedPosition if pos.owner != null && pos.owner != MemoizedTree.this =>
- assert(true)
pos.owner.dirtyTyped // hope this works!
case _ =>
}
@@ -302,13 +296,11 @@ trait IdeSupport extends Analyzer {
}
if (lastSymbol != NoSymbol && lastSymbol != use.last.symbol) {
assert(true)
- assert(true)
}
use.last.symbol
}
def doTyper = if (typerTxt ne NoContext) updateTyper(newTyper(typerTxt), mode, pt)
def updateTyper(typer : Typer, mode : Int, pt : Type) : Type = {
- assert(true)
val typerTxt = intern(typer.context)
val makeNoChanges = currentClient.makeNoChanges
@@ -323,8 +315,6 @@ trait IdeSupport extends Analyzer {
else if (typeIsDirty && shouldBeTyped && typerTxt != NoContext) {
} else if (lastType == null) {
- assert(true)
- assert(true)
return NoType
} else return lastType
var use = useTrees
@@ -334,7 +324,6 @@ trait IdeSupport extends Analyzer {
updateNamer(newNamer(namerTxt))
if (makeNoChanges) {
assert(true)
- assert(true)
}
activate(try {
setUseTrees{use = use.map{typer.typed(_,mode,pt)}; use}
@@ -349,14 +338,12 @@ trait IdeSupport extends Analyzer {
// the type changed in a good way.
typeChanged
}
- assert(true)
if (!makeNoChanges && (use.length != lastTyped.length || !use.zip(lastTyped).forall{
case (t0,t1) => t0.equalsStructure0(t1){
case (t0:StubTree,t1:StubTree) if t0.underlying == t0.underlying || true => true
case _ => false
}
})) {
- assert(true)
highlightChanged
}
if (use.last.tpe == null) ErrorType else use.last.tpe
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index ac35ecc052..9fb776c2d3 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -162,7 +162,6 @@ trait Namers { self: Analyzer =>
}
val sym0 = scope enter sym
if (sym0 ne sym) {
- assert(true)
Console.println("WEIRD: " + sym0 + " vs. " + sym + " " + sym0.id + " " + sym.id + " " + sym.sourceFile + " " + sym0.sourceFile)
}
if (prev != null && (sym0 ne prev.sym) && conflict(sym0,prev.sym)) {
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 5d61928388..49dacac6bc 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1041,7 +1041,6 @@ trait Typers { self: Analyzer =>
val typedMods = typedModifiers(cdef.mods)
val clazz = cdef.symbol;
if (inIDE && clazz == NoSymbol) {
- assert(true)
throw new TypeError("type signature typing failed")
}
assert(clazz != NoSymbol)
@@ -2378,7 +2377,6 @@ trait Typers { self: Analyzer =>
val DefDef(_, _, _, _, restpt, _) = enclMethod.tree
var restpt0 = restpt
if (inIDE && (restpt0.tpe eq null)) {
- assert(true)
restpt0 = typed(restpt0, TYPEmode, WildcardType)
}
if (restpt0.tpe eq null) {
diff --git a/src/compiler/scala/tools/nsc/util/CharArrayReader.scala b/src/compiler/scala/tools/nsc/util/CharArrayReader.scala
index d0702ab969..9a0659526a 100644
--- a/src/compiler/scala/tools/nsc/util/CharArrayReader.scala
+++ b/src/compiler/scala/tools/nsc/util/CharArrayReader.scala
@@ -53,7 +53,6 @@ class CharArrayReader(buf: RandomAccessSeq[Char], start: Int, /* startline: int,
def hasNext: Boolean = if (bp < buf.length) true
else {
- assert(true)
false
}
diff --git a/src/compiler/scala/tools/nsc/util/ClassPath.scala b/src/compiler/scala/tools/nsc/util/ClassPath.scala
index cb67f55c60..f2874a024b 100644
--- a/src/compiler/scala/tools/nsc/util/ClassPath.scala
+++ b/src/compiler/scala/tools/nsc/util/ClassPath.scala
@@ -276,7 +276,6 @@ class ClassPath(onlyPresentation: Boolean) {
if (sourceFile0 ne null) {
val file00 = sourceFile0.lookupPath("src", true)
if ((file00 ne null) && file00.isDirectory) {
- assert(true)
sourceFile0 = file00
}
}
diff --git a/src/compiler/scala/tools/nsc/util/SourceFile.scala b/src/compiler/scala/tools/nsc/util/SourceFile.scala
index b4cf891a44..315d3ad445 100644
--- a/src/compiler/scala/tools/nsc/util/SourceFile.scala
+++ b/src/compiler/scala/tools/nsc/util/SourceFile.scala
@@ -113,7 +113,6 @@ class BatchSourceFile(val file : AbstractFile, _content : Array[Char]) extends S
def find(toFind: Int, isIndex: Boolean): Int = {
if (toFind == 0) return 0
if (!isIndex && (toFind >= content.length)) {
- assert(true)
throw new Error(toFind + " not valid offset in " +
file.name + ":" + content.length)
}