From b6653dd87292cdcf373bc9d44778b7b37a09ce4b Mon Sep 17 00:00:00 2001 From: pyos Date: Mon, 2 Jan 2023 11:54:12 +0100 Subject: [PATCH] Minor: remove some duplicate test data Apparently if you add an empty line at the start of the FIR file, that's not enough of a difference for the test suite to complain about, but enough for it to not add the FIR_IDENTICAL directive... --- .../coercionWithExpectedTypeAndBound.fir.kt | 12 ------- .../coercionWithExpectedTypeAndBound.kt | 1 + .../coercionWithoutExpectedType.fir.kt | 18 ---------- .../coercionWithoutExpectedType.kt | 1 + .../indirectCoercionWithExpectedType.fir.kt | 35 ------------------- .../indirectCoercionWithExpectedType.kt | 1 + 6 files changed, 3 insertions(+), 65 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedTypeAndBound.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithoutExpectedType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/coercionToUnit/indirectCoercionWithExpectedType.fir.kt 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 {