diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedTypeAndBound.fir.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedTypeAndBound.fir.kt deleted file mode 100644 index 82000cf1a52..00000000000 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedTypeAndBound.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ - -fun materializeNumber(): T = TODO() - -fun a(): Unit = run { - materializeNumber() -} - -fun b(): Unit = run { - run { - materializeNumber() - } -} diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedTypeAndBound.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedTypeAndBound.kt index b2096a740cd..41f89d3d6ab 100644 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedTypeAndBound.kt +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedTypeAndBound.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun materializeNumber(): T = TODO() fun a(): Unit = run { diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithoutExpectedType.fir.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithoutExpectedType.fir.kt deleted file mode 100644 index f249cf9b507..00000000000 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithoutExpectedType.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ - -fun materialize(): T = TODO() - -fun implicitCoercion() { - val a = { - // Block is implicitly Unit-coerced, so it is allowed to place statement at the end of lambda - if (true) 42 - } - - val b = l@{ - return@l - } - - val c = l@{ - // Error: block doesn't have an expected type, so call can't be inferred! - return@l materialize() - } -} diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithoutExpectedType.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithoutExpectedType.kt index ec97a534275..556fc6be4dd 100644 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithoutExpectedType.kt +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithoutExpectedType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun materialize(): T = TODO() fun implicitCoercion() { diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/indirectCoercionWithExpectedType.fir.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/indirectCoercionWithExpectedType.fir.kt deleted file mode 100644 index ddff40abc7a..00000000000 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/indirectCoercionWithExpectedType.fir.kt +++ /dev/null @@ -1,35 +0,0 @@ - -fun materialize(): T = TODO() - -fun a(): Unit = run { - run { - // Ok, block is coerced, because it has (indirectly) Unit-expected type - "hello" - } -} - -fun b(): Unit = run { - // Ok, expected type is applied - materialize() -} - -fun c(): Unit = run { - run { - // Attention! - // In OI expected type 'Unit' isn't applied here because of implementation quirks (note that OI still applies Unit in case 'e') - // In NI, it is applied and call is correctly inferred, which is consistent with the previous case - materialize() - } -} - -fun d(): Unit = run outer@{ - run inner@{ - return@inner materialize() - } -} - -fun e(): Unit = run outer@{ - run inner@{ - return@outer materialize() - } -} diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/indirectCoercionWithExpectedType.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/indirectCoercionWithExpectedType.kt index f1e66019d15..6c3b5b324b7 100644 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/indirectCoercionWithExpectedType.kt +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/indirectCoercionWithExpectedType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun materialize(): T = TODO() fun a(): Unit = run {