Add regression test for already fixed issue KT-41396

This commit is contained in:
Victor Petukhov
2020-09-16 14:01:55 +03:00
parent 5e46e5355d
commit 17db188b0e
5 changed files with 57 additions and 0 deletions
@@ -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");
@@ -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)
}
@@ -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
}
@@ -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");
@@ -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");