Fix type parameter list for local classes
Add captured parameters from enclosing functions #KT-9584 Fixed
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
fun <T> magic(): T = null!!
|
||||
|
||||
class Q {
|
||||
private fun <E> foo() =
|
||||
object {
|
||||
val prop: E = magic()
|
||||
}
|
||||
|
||||
private var x = foo<CharSequence>()
|
||||
private var y = foo<String>()
|
||||
|
||||
fun bar() {
|
||||
x = <!TYPE_MISMATCH!>y<!>
|
||||
x = foo<CharSequence>()
|
||||
y = foo<String>()
|
||||
|
||||
x.prop.checkType { _<CharSequence>() }
|
||||
y.prop.checkType { _<String>() }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user