diff options
author | Paul Phillips <paulp@improving.org> | 2011-01-22 19:26:04 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-01-22 19:26:04 +0000 |
commit | da0d80743a2d799cbfbb00ada243f043fae3a759 (patch) | |
tree | d59eaa0599c092bb9b59d76487511973c915adfa /src | |
parent | 647d23d801a14a2bdd5e740325ef7d099aea15d7 (diff) | |
download | scala-da0d80743a2d799cbfbb00ada243f043fae3a759.tar.gz scala-da0d80743a2d799cbfbb00ada243f043fae3a759.tar.bz2 scala-da0d80743a2d799cbfbb00ada243f043fae3a759.zip |
Incorporated feedback on a couple recent commits.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Erasure.scala | 2 | ||||
-rw-r--r-- | src/library/scala/collection/SetLike.scala | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala index 7bba5fa227..6877f4585a 100644 --- a/src/compiler/scala/tools/nsc/transform/Erasure.scala +++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala @@ -966,7 +966,7 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer with ast. // This must be because some earlier transformation is being skipped on ##, but so // far I don't know what. We also crash on null.## but unless we want to implement // my good idea that null.## works (like null == "abc" works) we have to NPE. - val arg = qual.tpe.typeSymbol match { + val arg = qual.tpe.typeSymbolDirect match { case UnitClass => BLOCK(qual, REF(BoxedUnit_UNIT)) // ({ expr; UNIT }).## case NullClass => Typed(qual, TypeTree(ObjectClass.tpe)) // (null: Object).## case _ => qual diff --git a/src/library/scala/collection/SetLike.scala b/src/library/scala/collection/SetLike.scala index 7990837685..71c12be778 100644 --- a/src/library/scala/collection/SetLike.scala +++ b/src/library/scala/collection/SetLike.scala @@ -212,12 +212,13 @@ self => def subsetOf(that: Set[A]) = this forall that /** An iterator over all subsets of this set of the given size. + * If the requested size is impossible, an empty iterator is returned. * * @param len the size of the subsets. * @return the iterator. */ def subsets(len: Int): Iterator[This] = { - if (len < 0 || len > size) throw new IllegalArgumentException(len.toString) + if (len < 0 || len > size) Iterator.empty else new SubsetsItr(self.toIndexedSeq, len) } |