K2: reproduce KT-57873

This commit is contained in:
Mikhail Glukhikh
2023-04-17 18:33:59 +02:00
committed by Space Team
parent 66797ff876
commit 7bd5491498
7 changed files with 56 additions and 0 deletions
@@ -0,0 +1,15 @@
FILE: inferenceFromLambdaReturnType.kt
public final class ThemeKey<T> : R|kotlin/Any| {
public constructor<T>(): R|ThemeKey<T>| {
super<R|kotlin/Any|>()
}
}
public final fun <S> getWithFallback(fallback: R|(ThemeKey<S>) -> S|): R|kotlin/Unit| {
}
public final fun main(): R|kotlin/Unit| {
R|/getWithFallback|<R|kotlin/String|>(<L> = getWithFallback@fun <anonymous>(it: R|ThemeKey<ERROR CLASS: Type for S is not inferred>|): R|kotlin/String| <inline=NoInline> {
^ String()
}
)
}
@@ -0,0 +1,11 @@
// FIR_IDENTICAL
// FIR_DUMP
// ISSUE: KT-57873
class ThemeKey<T>
fun <S> getWithFallback(fallback: (ThemeKey<S>) -> S) {}
fun main() {
getWithFallback { "" }
}