Fix type parameter list for local classes

Add captured parameters from enclosing functions

 #KT-9584 Fixed
This commit is contained in:
Denis Zharkov
2015-12-21 18:37:03 +03:00
parent 73b961e885
commit 3fd35636ad
14 changed files with 287 additions and 13 deletions
@@ -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>() }
}
}