94c46d384a
```
interface A {
fun <T> foo(): T
}
class B(val a: A) : A by A {
generated fun <T'> foo(): T' {
return a.foo() // <------
}
}
```
There was a problem that type of generated delegated call used
an unsubstituted type of the original delegated declaration, which led
to a situation when (see example) type of call `a.foo()` was not `T'`
but `T`, which led to incorrect IR and further exceptions on backend
^KT-64257 Fixed
^KT-64284 Obsolete
16 lines
341 B
Kotlin
Vendored
16 lines
341 B
Kotlin
Vendored
// ISSUE: KT-64257
|
|
|
|
interface Base {
|
|
fun <R> fold(initial: R, operation: (R, String) -> R): R = operation(initial, "K")
|
|
}
|
|
|
|
interface Derived<T> : Base
|
|
|
|
class Impl<T> : Derived<T>
|
|
|
|
fun box(): String {
|
|
val impl = Impl<String>()
|
|
val delegated = object : Derived<String> by impl {}
|
|
return delegated.fold("O") { a, b -> a + b }
|
|
}
|