diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java index 5eadec45ee5..c7d398a3239 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java @@ -328,6 +328,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte runTest("compiler/testData/diagnostics/tests/kt310.kt"); } + @TestMetadata("kt34440.kt") + public void testKt34440() throws Exception { + runTest("compiler/testData/diagnostics/tests/kt34440.kt"); + } + @TestMetadata("kt34857.kt") public void testKt34857() throws Exception { runTest("compiler/testData/diagnostics/tests/kt34857.kt"); diff --git a/compiler/psi/src/org/jetbrains/kotlin/parsing/AbstractKotlinParsing.java b/compiler/psi/src/org/jetbrains/kotlin/parsing/AbstractKotlinParsing.java index 0af6879e70c..b262daab95c 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/parsing/AbstractKotlinParsing.java +++ b/compiler/psi/src/org/jetbrains/kotlin/parsing/AbstractKotlinParsing.java @@ -105,7 +105,7 @@ import static org.jetbrains.kotlin.lexer.KtTokens.*; IElementType tt = tt(); if (recoverySet == null || recoverySet.contains(tt) || - tt == LBRACE || tt == RBRACE || + tt == LBRACE || tt == RBRACE || tt == LONG_TEMPLATE_ENTRY_END || (recoverySet.contains(EOL_OR_SEMICOLON) && (eof() || tt == SEMICOLON || myBuilder.newlineBeforeCurrentToken()))) { error(message); } diff --git a/compiler/testData/diagnostics/tests/kt34440.fir.kt b/compiler/testData/diagnostics/tests/kt34440.fir.kt new file mode 100644 index 00000000000..0d2e2a2c894 --- /dev/null +++ b/compiler/testData/diagnostics/tests/kt34440.fir.kt @@ -0,0 +1,9 @@ +// ISSUE: KT-34440 + +class BufferUtil { + fun isDirect(cond: Boolean): Boolean = + when (cond) { + else -> throw Exception("${buf.}") + } + private class BufferInfo(private val type: Class<*>) +} diff --git a/compiler/testData/diagnostics/tests/kt34440.kt b/compiler/testData/diagnostics/tests/kt34440.kt new file mode 100644 index 00000000000..bc4e307b475 --- /dev/null +++ b/compiler/testData/diagnostics/tests/kt34440.kt @@ -0,0 +1,9 @@ +// ISSUE: KT-34440 + +class BufferUtil { + fun isDirect(cond: Boolean): Boolean = + when (cond) { + else -> throw Exception("${buf.}") + } + private class BufferInfo(private val type: Class<*>) +} diff --git a/compiler/testData/diagnostics/tests/kt34440.txt b/compiler/testData/diagnostics/tests/kt34440.txt new file mode 100644 index 00000000000..ae461cc5456 --- /dev/null +++ b/compiler/testData/diagnostics/tests/kt34440.txt @@ -0,0 +1,17 @@ +package + +public final class BufferUtil { + public constructor BufferUtil() + 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 final fun isDirect(/*0*/ cond: kotlin.Boolean): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + private final class BufferInfo { + public constructor BufferInfo(/*0*/ type: java.lang.Class<*>) + private final val type: java.lang.Class<*> + 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 + } +} diff --git a/compiler/tests-gen/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index c2d9b7057ba..cb8ec64cf4f 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -330,6 +330,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTestWithFirVali runTest("compiler/testData/diagnostics/tests/kt310.kt"); } + @TestMetadata("kt34440.kt") + public void testKt34440() throws Exception { + runTest("compiler/testData/diagnostics/tests/kt34440.kt"); + } + @TestMetadata("kt34857.kt") public void testKt34857() throws Exception { runTest("compiler/testData/diagnostics/tests/kt34857.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java index c48401eb6d1..6c5f6fceffd 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java @@ -330,6 +330,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing runTest("compiler/testData/diagnostics/tests/kt310.kt"); } + @TestMetadata("kt34440.kt") + public void testKt34440() throws Exception { + runTest("compiler/testData/diagnostics/tests/kt34440.kt"); + } + @TestMetadata("kt34857.kt") public void testKt34857() throws Exception { runTest("compiler/testData/diagnostics/tests/kt34857.kt");