diff --git a/compiler/testData/diagnostics/tests/callableReference/callableReferenceAsLastExpressionInBlock.kt b/compiler/testData/diagnostics/tests/callableReference/callableReferenceAsLastExpressionInBlock.kt index e31bf9e397d..d97dfe23998 100644 --- a/compiler/testData/diagnostics/tests/callableReference/callableReferenceAsLastExpressionInBlock.kt +++ b/compiler/testData/diagnostics/tests/callableReference/callableReferenceAsLastExpressionInBlock.kt @@ -4,6 +4,7 @@ * RELEVANT SPEC SENTENCES (spec version: 0.1-220, test type: pos): * - expressions, call-and-property-access-expressions, callable-references -> paragraph 11 -> sentence 3 */ + import kotlin.reflect.KFunction0 fun test() { diff --git a/compiler/testData/diagnostics/tests/callableReference/correctInfoAfterArrayLikeCall.kt b/compiler/testData/diagnostics/tests/callableReference/correctInfoAfterArrayLikeCall.kt index d2026f0a6bf..1d6fecadf39 100644 --- a/compiler/testData/diagnostics/tests/callableReference/correctInfoAfterArrayLikeCall.kt +++ b/compiler/testData/diagnostics/tests/callableReference/correctInfoAfterArrayLikeCall.kt @@ -5,6 +5,7 @@ * - expressions, call-and-property-access-expressions, navigation-operators -> paragraph 9 -> sentence 2 * - expressions, call-and-property-access-expressions, navigation-operators -> paragraph 8 -> sentence 1 */ + import kotlin.reflect.KProperty1 class DTO { diff --git a/compiler/testData/diagnostics/tests/when/When.fir.kt b/compiler/testData/diagnostics/tests/when/When.fir.kt index 287bc1ea340..7a7be97f158 100644 --- a/compiler/testData/diagnostics/tests/when/When.fir.kt +++ b/compiler/testData/diagnostics/tests/when/When.fir.kt @@ -1,4 +1,5 @@ // !WITH_NEW_INFERENCE + fun Int.foo() : Boolean = true fun foo() : Int { diff --git a/compiler/testData/diagnostics/tests/when/kt10439.fir.kt b/compiler/testData/diagnostics/tests/when/kt10439.fir.kt index fe6325b748a..72d49f53481 100644 --- a/compiler/testData/diagnostics/tests/when/kt10439.fir.kt +++ b/compiler/testData/diagnostics/tests/when/kt10439.fir.kt @@ -1,4 +1,5 @@ // !WITH_NEW_INFERENCE + fun foo(x: Int) = x fun test0(flag: Boolean) { diff --git a/compiler/testData/diagnostics/tests/when/kt9972.fir.kt b/compiler/testData/diagnostics/tests/when/kt9972.fir.kt index b5265b36f1a..4db13805be5 100644 --- a/compiler/testData/diagnostics/tests/when/kt9972.fir.kt +++ b/compiler/testData/diagnostics/tests/when/kt9972.fir.kt @@ -1,4 +1,5 @@ // !WITH_NEW_INFERENCE + fun test1(): Int { val x: String = if (true) { when { diff --git a/compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.fir.kt b/compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.fir.kt index e82e0a7bae4..8f793c6fb58 100644 --- a/compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.fir.kt +++ b/compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.fir.kt @@ -1,4 +1,5 @@ // !WITH_NEW_INFERENCE + val test1: (String) -> Boolean = when { true -> {{ true }} diff --git a/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.fir.kt b/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.fir.kt index ecdc4aeaa90..22c7a8247c6 100644 --- a/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.fir.kt +++ b/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.fir.kt @@ -1,5 +1,6 @@ // !WITH_NEW_INFERENCE // NI_EXPECTED_FILE + val test1 = when { true -> { { true } } else -> TODO() diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/BaseDiagnosticsTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/BaseDiagnosticsTest.kt index 5456b5e1b75..ec802d75965 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/BaseDiagnosticsTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/BaseDiagnosticsTest.kt @@ -412,6 +412,7 @@ abstract class BaseDiagnosticsTest : KotlinMultiFileTestWithJava|") + val SPEC_LINKS_IN_TESTDATA_PATTERN = Regex("""/\*\s+\*\s+RELEVANT SPEC SENTENCES[\w\W]*?\*/\n""") fun parseDiagnosticFilterDirective( directiveMap: Directives, diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/FirTestUtils.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/FirTestUtils.kt index 9a9f3e3be2f..199a35a07ef 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/FirTestUtils.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/FirTestUtils.kt @@ -8,6 +8,7 @@ package org.jetbrains.kotlin.fir import com.intellij.openapi.util.text.StringUtil import junit.framework.TestCase import org.jetbrains.kotlin.checkers.BaseDiagnosticsTest.Companion.DIAGNOSTIC_IN_TESTDATA_PATTERN +import org.jetbrains.kotlin.checkers.BaseDiagnosticsTest.Companion.SPEC_LINKS_IN_TESTDATA_PATTERN import org.jetbrains.kotlin.test.KotlinTestUtils import org.jetbrains.kotlin.test.util.trimTrailingWhitespacesAndAddNewlineAtEOF import java.io.File @@ -51,6 +52,8 @@ fun compareAndMergeFirFileAndOldFrontendFile( } fun loadTestDataWithoutDiagnostics(file: File): String { - val textWithoutDiagnostics = KotlinTestUtils.doLoadFile(file).replace(DIAGNOSTIC_IN_TESTDATA_PATTERN, "") + val textWithoutDiagnostics = KotlinTestUtils.doLoadFile(file) + .replace(DIAGNOSTIC_IN_TESTDATA_PATTERN, "") + .replace(SPEC_LINKS_IN_TESTDATA_PATTERN, "") return StringUtil.convertLineSeparators(textWithoutDiagnostics.trim()).trimTrailingWhitespacesAndAddNewlineAtEOF() }