scala/scala — pull request #4145 by som-snytt (2014-11-22 01:14:48+00:00)
Title: SI-8924 No outer ref in LinearSeq iterator

The iterator for `LinearSeqLike` holds an outer pointer via
the call to `newBuilder`, which is used to empty the underlying
sequence on `toList`.

A better strategy is to use `these take 0` to create the empty
`Seq`. We can rely on `take 0` to mean the empty `Repr`.

The unit test confirms that a weak reference to the sequence
is collectable after `seq.iterator.toList`.