Merge pull request #2344 from retronym/ticket/7147

SI-7147 Diagnostic for unexplained assertion in presentation compiler.
Take the N^2 out of the compiler's TreeSet.

The code responsible for this performance bug lives on somewhere
in the combination of Iterator.single and Iterator.++ and is
tracked by SI-7316. What this commit does is bypass the creation
and composition of iterators entirely in favor of applying foreach
to walking the tree.

The important lesson of a bug like this: the occurrence depends on
the existence of multiple implementations of basic structures like
Trees. For each redundant implementation, scrutiny and testing
are divided and "bug diversity" is increased. We should labor
hard to structure collections in such a way that people have no
good reason not to take advantage of the basic and hopefully
battle-tested logic - especially when those people are us.

I hope to remove util.TreeSet entirely. Until then, here is the
impact of this commit on the time to compile a piece of generated
test code.

  % time scalac3 ./target/generated/src.scala
  Mar 28 13:20:31 [running phase parser on src.scala]
  ...
  Mar 28 13:21:28 [running phase lazyvals on src.scala]
  Mar 28 13:21:28 [running phase lambdalift on src.scala]  <-- WHOA
  Mar 28 13:25:05 [running phase constructors on src.scala]
  ...
  Mar 28 13:25:19 [running phase jvm on icode]
  316.387 real, 438.182 user, 8.163 sys

To this:

  97.927 real, 211.015 user, 8.043 sys

  % time pscalac ./target/generated/src.scala
  Mar 28 13:18:47 [running phase parser on src.scala]
  ...
  Mar 28 13:19:44 [running phase lazyvals on src.scala]
  Mar 28 13:19:44 [running phase lambdalift on src.scala]
  Mar 28 13:19:46 [running phase constructors on src.scala]
  ...
  Mar 28 13:19:57 [running phase jvm on icode]
  99.909 real, 223.605 user, 7.847 sys

That's lambdalift dropping from 217 seconds to 2 seconds.
Merge pull request #2331 from paulp/pr/iterator-pathology

Take the N^2 out of the compiler's TreeSet.
Merge pull request #2298 from retronym/ticket/6900-3

SI-6900 Tail call elimination + dependent method type crasher
SI-7321 Memory leak in specialize on multiple compiler runs.

Currently the map is declared LinkedHashMap, which doesn't align with
other caching maps that are cleared on every run. Linkedness is only
needed to ensure deterministic order on the generated specialized
classes. The same can be accomplished by sorting generated classes
a-posteriori.
Merge pull request #2346 from adriaanm/build-zinc

Make build even more regular
make quick.done depend on quick.bin again
assume build.release when maven.version.suffix is set
if starr.use.released fetch Scala ${starr.version} for STARR

I recommend creating a build.properties file as follows:

```
locker.skip=1
starr.use.released=1
```

This will download the Scala version specified in starr.number,
use it to build quick, skipping locker.
Merge pull request #2351 from vigdorchik/ticket/si-7321b

SI-7321 Memory leak in specialize on multiple compiler runs.
Merge pull request #2359 from adriaanm/build

some more build fixes
SI-7319 Clear error buffer during Typer reset.

And warn under -Xdev, because we shouldn't get here.

In the enclosed test, the error buffer of `startContext`
contained a reported but unflushed type error.

I believe the culprit is `typerReportAnyContextErrors`,
which will be addressed in the next commit.
SI-7319 Flush error buffer in typerReportAnyContextErrors.

After this change, we no longer rely on the backstop in resetContexts
introduced in the previous commit.