Add regression test for already fixed issue KT-41396
This commit is contained in:
+5
@@ -2116,6 +2116,11 @@ public class FirOldFrontendDiagnosticsTestWithStdlibGenerated extends AbstractFi
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt41396.kt")
|
||||
public void testKt41396() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41396.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nestedLambdaInferenceWithListMap.kt")
|
||||
public void testNestedLambdaInferenceWithListMap() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/nestedLambdaInferenceWithListMap.kt");
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -EXPERIMENTAL_API_USAGE_ERROR -UNUSED_PARAMETER -CAST_NEVER_SUCCEEDS
|
||||
|
||||
fun <T, R> Flow<T>.transformLatest(@BuilderInference transform: suspend FlowCollector<R>.(value: T) -> Unit) = null as Flow<R>
|
||||
|
||||
interface Flow<out T> {
|
||||
suspend fun collect(collector: FlowCollector<T>)
|
||||
}
|
||||
|
||||
interface FlowCollector<in T> {
|
||||
suspend fun emit(value: T)
|
||||
}
|
||||
|
||||
fun <T> flow(@BuilderInference block: suspend FlowCollector<T>.() -> Unit) = null as Flow<T>
|
||||
fun <T> flowOf(value: T) = null as Flow<T>
|
||||
|
||||
fun foo() = flow {
|
||||
flowOf(false).transformLatest {
|
||||
emit(false)
|
||||
}
|
||||
emit(0)
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ T> flow(/*0*/ @kotlin.BuilderInference block: suspend FlowCollector<T>.() -> kotlin.Unit): Flow<T>
|
||||
public fun </*0*/ T> flowOf(/*0*/ value: T): Flow<T>
|
||||
public fun foo(): Flow<kotlin.Int>
|
||||
public fun </*0*/ T, /*1*/ R> Flow<T>.transformLatest(/*0*/ @kotlin.BuilderInference transform: suspend FlowCollector<R>.(value: T) -> kotlin.Unit): Flow<R>
|
||||
|
||||
public interface Flow</*0*/ out T> {
|
||||
public abstract suspend fun collect(/*0*/ collector: FlowCollector<T>): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface FlowCollector</*0*/ in T> {
|
||||
public abstract suspend fun emit(/*0*/ value: T): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+5
@@ -2156,6 +2156,11 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt41396.kt")
|
||||
public void testKt41396() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41396.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nestedLambdaInferenceWithListMap.kt")
|
||||
public void testNestedLambdaInferenceWithListMap() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/nestedLambdaInferenceWithListMap.kt");
|
||||
|
||||
compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java
Generated
+5
@@ -2156,6 +2156,11 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt41396.kt")
|
||||
public void testKt41396() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41396.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nestedLambdaInferenceWithListMap.kt")
|
||||
public void testNestedLambdaInferenceWithListMap() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/nestedLambdaInferenceWithListMap.kt");
|
||||
|
||||
Reference in New Issue
Block a user