summaryrefslogtreecommitdiff
path: root/test/files/neg/t2316.scala
Commit message (Collapse)AuthorAgeFilesLines
* fixed #2316: No longer cache entire SearchResul...Adriaan Moors2009-09-291-0/+43
fixed #2316: No longer cache entire SearchResult when looking for implicits in the parts of the expected type. (patch by retronym -- see ticket) A SearchResult may contain symbols local to the scope of the search that were used as implicit parameters, so they are not safely cacheable. The fix for #2101 does not suffice. That patch avoided bound symbols being duplicated, but the problem is much worse. The implicits for an expected type depend on more than just that type, so we cannot cache them using the expected type as a key. The neg/t2316 test illustrates this: T1 may provide two implicits, one requires an implicit T2, another an implicit T3. If an implicit T1 is first required when only a T2 is in scope, the SearchResult will describe the corresponding implicit. Now, if we enter an implicit value of type T3 into scope, the search should fail (it is ambiguous), but the cache does not take this new fact into account. The patch replaces the erroneous aggressive caching with a more conservative version that only caches ImplicitInfo's.