scala/scala — pull request #3645 by retronym (2014-03-21 11:12:27+00:00)
Title: SI-8430 Less non-determinism in patmat exhautiveness warnings

Another mole whacked on the head by using `LinkedHashMap`.

Caution: `LinkedHashMap` doesn't preserve its runtime type if
you map through the generic interface. I've noted this gotcha as
SI-8434. I've structured this patch to enforce that concrete
collection with types, which is a good idea anyway.

My method to track this down was to place breakpoints in
`Hash{Map,Set}`.{foreach,iterator}` to see where that was
used from within pattern match translation. This approach was
drastically faster than my previous rounds of whack-a-mole.

The counter-examples are still a bit off; I'm going to merge
that aspect of this ticket with SI-7746, in which we've
pinpointed the culpable part of the implementation, but haven't
had success in fixing the bug.

Review by @adriaanm. This should probably wait for 2.11.1 as
it isn't blocker material.