From f3364ec602f0b886f17f7af075573c63ceca03a5 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Tue, 26 Jan 2021 17:05:43 +0300 Subject: [PATCH] [TD] Update testdata according to KT-44546 --- .../inference/lambdaParameterTypeInElvis.fir.kt | 14 ++++++++++++++ .../tests/inference/lambdaParameterTypeInElvis.kt | 3 +-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/inference/lambdaParameterTypeInElvis.fir.kt diff --git a/compiler/testData/diagnostics/tests/inference/lambdaParameterTypeInElvis.fir.kt b/compiler/testData/diagnostics/tests/inference/lambdaParameterTypeInElvis.fir.kt new file mode 100644 index 00000000000..08cdc63c5a2 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/lambdaParameterTypeInElvis.fir.kt @@ -0,0 +1,14 @@ +// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -UNREACHABLE_CODE + +interface Some { + fun method(): Unit +} + +fun elvis(nullable: S?, notNullable: S): S = TODO() + +fun Some.doWithPredicate(predicate: (R) -> Unit): R? = TODO() + +fun test(derived: Some) { + val expected: Some = derived.doWithPredicate { it.method() } ?: TODO() + val expected2: Some = elvis(derived.doWithPredicate { it.method() }, TODO()) +} diff --git a/compiler/testData/diagnostics/tests/inference/lambdaParameterTypeInElvis.kt b/compiler/testData/diagnostics/tests/inference/lambdaParameterTypeInElvis.kt index a365e67ebef..1c4ce614a63 100644 --- a/compiler/testData/diagnostics/tests/inference/lambdaParameterTypeInElvis.kt +++ b/compiler/testData/diagnostics/tests/inference/lambdaParameterTypeInElvis.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -UNREACHABLE_CODE interface Some { @@ -11,5 +10,5 @@ fun Some.doWithPredicate(predicate: (R) -> Unit): R? = TODO() fun test(derived: Some) { val expected: Some = derived.doWithPredicate { it.method() } ?: TODO() - val expected2: Some = elvis(derived.doWithPredicate { it.method() }, TODO()) + val expected2: Some = elvis(derived.doWithPredicate { it.method() }, TODO()) }