FIR: use captureFromTypeParameterUpperBoundIfNeeded for argument types

#KT-48161 Fixed
This commit is contained in:
Mikhail Glukhikh
2021-08-09 12:19:49 +03:00
parent 73a8b4544a
commit a04913a197
7 changed files with 58 additions and 4 deletions
@@ -0,0 +1,24 @@
FILE: WithSpeedSearch.kt
public final class JList<E> : R|kotlin/Any| {
public constructor<E>(): R|JList<E>| {
super<R|kotlin/Any|>()
}
}
public final class ListSpeedSearch<T> : R|kotlin/Any| {
public constructor<T>(list: R|JList<T>|): R|ListSpeedSearch<T>| {
super<R|kotlin/Any|>()
}
}
public final class XThreadsFramesView : R|kotlin/Any| {
public constructor(): R|XThreadsFramesView| {
super<R|kotlin/Any|>()
}
private final fun <J : R|JList<*>|> R|J|.withSpeedSearch(): R|J| {
lval search: R|ListSpeedSearch<out kotlin/Any?>| = R|/ListSpeedSearch.ListSpeedSearch|<R|CapturedType(*)|>(this@R|/XThreadsFramesView.withSpeedSearch|)
^withSpeedSearch this@R|/XThreadsFramesView.withSpeedSearch|
}
}
@@ -0,0 +1,10 @@
class JList<E>
class ListSpeedSearch<T>(list: JList<T>)
class XThreadsFramesView {
private fun <J> J.withSpeedSearch(): J where J : JList<*> {
val search = ListSpeedSearch(this)
return this
}
}