diff options
author | Martin Odersky <odersky@gmail.com> | 2009-11-27 10:00:44 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-11-27 10:00:44 +0000 |
commit | b06fc095fcde65af1c7db11feb1dc37cf91beca7 (patch) | |
tree | acfc6cc85b5b9b8964ae8257bb01fd9583fca9a5 | |
parent | 3d10835062e0b0601026612f414c333269db609f (diff) | |
download | scala-b06fc095fcde65af1c7db11feb1dc37cf91beca7.tar.gz scala-b06fc095fcde65af1c7db11feb1dc37cf91beca7.tar.bz2 scala-b06fc095fcde65af1c7db11feb1dc37cf91beca7.zip |
Made Symbols.filter more robost.
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Symbols.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala index 1634e04025..2369456b11 100644 --- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala +++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala @@ -1079,8 +1079,9 @@ trait Symbols { else if (alts1.isEmpty) NoSymbol else if (alts1.tail.isEmpty) alts1.head else owner.newOverloaded(info.prefix, alts1) - } else if (cond(this)) this - else NoSymbol + } else if (this == NoSymbol || cond(this)) { + this + } else NoSymbol def suchThat(cond: Symbol => Boolean): Symbol = { val result = filter(cond) |