FIR: Support flexible types in getErasedVersionOfFirstUpperBound

This commit is contained in:
Denis Zharkov
2020-02-11 17:36:16 +03:00
parent 42e8017bde
commit 95b4fa4b31
23 changed files with 47 additions and 30 deletions
@@ -22,7 +22,7 @@ val strList: List<String> = null!!
fun main() {
val rawA = Test.rawAField
rawA.first = Test.rawAField.second
Test.rawAField.second = rawA.first.<!INAPPLICABLE_CANDIDATE!>second<!>
Test.rawAField.second = rawA.first.second
rawA.listOfDoubles = strList
rawA.listOfDoubles = "" // first should be List
@@ -27,12 +27,12 @@ public class Test {
fun foo(x: B<*>) {
// TODO: x.foo() now is flexible type instead of raw, because of captured type approximation
val q: MutableList<String> = x.foo().<!INAPPLICABLE_CANDIDATE!>getChildrenStubs<!>()
val q: MutableList<String> = x.foo().getChildrenStubs()
// Raw(B).field erased to A<Any!>..A<out Any!>?
Test.rawB.field = A<String>()
val anyA: A<Any> = Test.rawB.field
Test.rawB.field.<!INAPPLICABLE_CANDIDATE!>consume<!>("")
val y: Any = Test.rawB.field.<!INAPPLICABLE_CANDIDATE!>produce<!>()
Test.rawB.field.consume("")
val y: Any = Test.rawB.field.produce()
}