mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-18 00:21:35 +00:00
See doNotCaptureSupertype test for clarification: When resolving b.collect(toList()) we're building a common system with two variables T and R. The problem was that when introducing the constraint C<T, Inv<T>> <: C<in String, R> we then were seeing the constraint T <= in String, and add the constaint T=Captured(in String) That lead to R=Inv<T>=Inv<Captured(in String)>, and after approximation R=Inv<in String>, that is not the desirable result (Inv<String> suits here) But the root problem was that we add captured constaint when projection was from supertype, that seems to be wrong, and for example Java doesn't do that in the similar situation. #KT-11259 Fixed