Files
kotlin-fork/compiler/testData/codegen/box/delegation/smartCastedDelegation.kt
T
Kirill Rakhman e80b4c530d [FIR2IR] Properly handle intersection types in interface delegation
The changes to the irText test data result in the fact that we
now unconditionally unwrap substitution overrides of delegation targets
whereas before we built an unsubstituted scope of the type we delegate
to. If we delegate to a class A : B<C>, the unsubstituted scope of
A can still contain substitution overrides for inherited generic methods
from B<T> that we didn't unwrap before but do unwrap now.

#KT-57899 Fixed
2023-04-20 08:12:55 +00:00

12 lines
277 B
Kotlin
Vendored

interface DosFileAttributeView {
fun bar(): String
}
fun <V> foo(view: V): DosFileAttributeView {
view as DosFileAttributeView
return object : DosFileAttributeView by view {}
}
fun box() = foo(object : DosFileAttributeView {
override fun bar() = "OK"
}).bar()