scala/scala — pull request #268 by adriaanm (2012-03-09 08:47:02+00:00)
Title: SI-5189: sound GADT type inference

this bug has two aspects:

1. inferConstrInstance used the wrong type to compute the variance (first two commits clean it up and fix the variance computation)

2. adaptConstrPattern did not set the stage correctly for inferConstrInstance: need to approximate the expected type against which we do inference to reflect subsumption it method application (i.e., make the mismatch between dynamic and static types explicit, reflecting variance, using existential skolems)

review by everyone, especially @odersky