summaryrefslogtreecommitdiff
path: root/test/files/pos/t8934a
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-09-30 16:09:04 +1000
committerJason Zaugg <jzaugg@gmail.com>2015-09-30 16:09:04 +1000
commitfbdfc83b5f0b3a2d2962c1adad8875a7e58d6497 (patch)
tree39c2ded6c0a4426af883a3e47a08a8d502b80245 /test/files/pos/t8934a
parentd770340a25562eecf6b0aa576f412530668fcdce (diff)
downloadscala-fbdfc83b5f0b3a2d2962c1adad8875a7e58d6497.tar.gz
scala-fbdfc83b5f0b3a2d2962c1adad8875a7e58d6497.tar.bz2
scala-fbdfc83b5f0b3a2d2962c1adad8875a7e58d6497.zip
SI-9498 Avoid caching bug with pattern type variables
Typechecking a pattern that defines a pattern type variable initially assigns abstract type symbol with open type bounds. Later on, pattern type inference kicks in to sharpen the type of the variable based on constraints imposed by the expected type (ie, the type of scrutinee of the pattern.) However, before inference does this, a `TypeRef` to the abstract type symbol can be queried for its base type with respect to some class, which leads to it populating an internal cache. This cache becomes stale when the underlying symbol has its type mutated. The repercussions of this meant that a subsequent call to `baseType` gave the wrong result (`NoType`), which lead to an `asSeenFrom` operation to miss out of substitution of a type variable. Note the appearance of `A` in the old type errors in the enclosed test case. This commit takes an approach similar to 286dafbd to invalidate caches after the mutation. I've routed both bandaids through the same first aid kit: I'm sure over time we'll add additional calls to this method, and additional cache invalidations within it.
Diffstat (limited to 'test/files/pos/t8934a')
0 files changed, 0 insertions, 0 deletions