Use 'mapToCallableMethod' for delegateTo signature calculation
#KT-9707 Fixed
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
open class Content() {
|
||||
override fun toString() = "OK"
|
||||
}
|
||||
|
||||
interface Box<E> {
|
||||
fun get(): E
|
||||
}
|
||||
|
||||
interface ContentBox<T : Content> : Box<T>
|
||||
|
||||
object Impl : ContentBox<Content> {
|
||||
override fun get(): Content = Content()
|
||||
}
|
||||
|
||||
class ContentBoxDelegate<T : Content>() : ContentBox<T> by (Impl as ContentBox<T>)
|
||||
|
||||
fun box() = ContentBoxDelegate<Content>().get().toString()
|
||||
@@ -0,0 +1,18 @@
|
||||
import java.util.*
|
||||
|
||||
open class Content() {
|
||||
override fun toString() = "OK"
|
||||
}
|
||||
|
||||
interface ContentBox<T : Content> : List<T>
|
||||
|
||||
object Impl : ContentBox<Content> , AbstractList<Content>() {
|
||||
override fun get(index: Int) = Content()
|
||||
|
||||
override val size: Int
|
||||
get() = throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
class ContentBoxDelegate<T : Content>() : ContentBox<T> by (Impl as ContentBox<T>)
|
||||
|
||||
fun box() = ContentBoxDelegate<Content>()[0].toString()
|
||||
Reference in New Issue
Block a user