[FIR] Initialize outer type parameters for local classes

This commit is contained in:
Ivan Kochurkin
2021-09-15 19:28:02 +03:00
committed by TeamCityServer
parent 38820d3e41
commit e52a410599
39 changed files with 293 additions and 193 deletions
@@ -19,14 +19,14 @@ private class Outer<E> {
private var doubleStringInt = Outer<Double>().Inner<String>().foo<Int>()()
private fun bar() {
doubleCharSequenceInt = doubleStringNumber
doubleCharSequenceInt = <!ASSIGNMENT_TYPE_MISMATCH!>doubleStringNumber<!>
doubleCharSequenceInt = doubleStringInt
doubleStringInt = Outer<Double>().Inner<String>().foo<Int>()()
doubleStringInt.e.checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><Double>() }
doubleStringInt.f.checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><String>() }
doubleStringInt.g.checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><Int>() }
doubleStringInt.e.checkType { _<Double>() }
doubleStringInt.f.checkType { _<String>() }
doubleStringInt.g.checkType { _<Int>() }
}
}
}
@@ -14,11 +14,11 @@ class Q {
private var y = foo<String>()()
fun bar() {
x = y
x = <!ASSIGNMENT_TYPE_MISMATCH!>y<!>
x = foo<CharSequence>()()
y = foo<String>()()
x.prop.checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><CharSequence>() }
y.prop.checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><String>() }
x.prop.checkType { _<CharSequence>() }
y.prop.checkType { _<String>() }
}
}
@@ -15,8 +15,8 @@ class Q {
private var x = foo<CharSequence, Number>()()
fun bar() {
x.e.checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><CharSequence>() }
x.f.checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><Number>() }
x.e.checkType { _<CharSequence>() }
x.f.checkType { _<Number>() }
x.g.checkType { _<Number>() }
}
}
@@ -1,16 +1,16 @@
fun <E> foo(x: Any, y: Any) : Any {
class C
// without E?
if(x is C) {
if(x is <!NO_TYPE_ARGUMENTS_ON_RHS!>C<!>) {
return x
}
if (1 == 2) {
x as C
x as <!NO_TYPE_ARGUMENTS_ON_RHS!>C<!>
}
if (2 == 3) {
x as? C
x as? <!NO_TYPE_ARGUMENTS_ON_RHS, NO_TYPE_ARGUMENTS_ON_RHS!>C<!>
}
class Outer<F> {