[FIR] Java super-type arguments are now handled as flexible

This commit is contained in:
Mikhail Glukhikh
2020-01-31 12:57:29 +03:00
parent aeb6f35571
commit 91b432b4a1
32 changed files with 122 additions and 93 deletions
@@ -28,11 +28,11 @@ interface WithFoo {
fun <M2: WithFoo> foo(delegateResolver: ResolverForProject<M2?>): ResolverForProject<M2?> {
val descriptorByModule = MyMap<M2, String>()
val result = <!INAPPLICABLE_CANDIDATE!>ResolverForProjectImpl<!>(descriptorByModule, delegateResolver)
result.<!UNRESOLVED_REFERENCE!>exposeM<!>.<!UNRESOLVED_REFERENCE!>foo<!>() // M is not M2?
result.<!UNRESOLVED_REFERENCE!>exposeM<!>?.<!UNRESOLVED_REFERENCE!>foo<!>() // no warning, M is not M2, hense M is M2!
val result = ResolverForProjectImpl(descriptorByModule, delegateResolver)
result.exposeM.foo() // M is not M2?
result.exposeM?.foo() // no warning, M is not M2, hense M is M2!
return <!INAPPLICABLE_CANDIDATE!>ResolverForProjectImpl<!>(descriptorByModule, delegateResolver) // another bound check
return ResolverForProjectImpl(descriptorByModule, delegateResolver) // another bound check
}
// MyMap<M2, String> :< Map<M, String> => M = M2!
@@ -22,10 +22,10 @@ fun test(b: B, c: C, d: D, e: E) {
eatAString(d)
eatAString(e)
<!INAPPLICABLE_CANDIDATE!>eatAStringN<!>(b)
<!INAPPLICABLE_CANDIDATE!>eatAStringN<!>(c)
<!INAPPLICABLE_CANDIDATE!>eatAStringN<!>(d)
<!INAPPLICABLE_CANDIDATE!>eatAStringN<!>(e)
eatAStringN(b)
eatAStringN(c)
eatAStringN(d)
eatAStringN(e)
}
// FILE: 3.kt