FIR: fix substitution of type arguments in SAM type aliases
^KT-54730 Fixed
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
fun interface KRunnable {
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
fun interface KConsumer<T> {
|
||||
fun accept(value: T)
|
||||
}
|
||||
|
||||
typealias KRunnableAlias = KRunnable
|
||||
|
||||
typealias StringConsumer = KConsumer<String>
|
||||
|
||||
fun foo(f: KRunnable) = f
|
||||
|
||||
fun <T> bar(f: KConsumer<T>) = f
|
||||
|
||||
fun box(): String {
|
||||
var result = ""
|
||||
foo(KRunnable {
|
||||
bar(KConsumer<String> {
|
||||
result += it
|
||||
}).accept("O")
|
||||
}).invoke()
|
||||
foo(KRunnableAlias {
|
||||
bar(StringConsumer {
|
||||
result += it
|
||||
}).accept("K")
|
||||
}).invoke()
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user