From 56eedfebeed54fdb4fb301d178764cb1230abc71 Mon Sep 17 00:00:00 2001 From: Vladimir Sukharev Date: Fri, 22 Sep 2023 11:18:19 +0000 Subject: [PATCH] [FIR] K2: Fix disappeared diagnostic UNDERSCORE_USAGE_WITHOUT_BACKTICKS on types ^KT-59985 Fixed Merge-request: KT-MR-12282 Merged-by: Vladimir Sukharev --- .../analysis/checkers/FirUnderscoreHelpers.kt | 30 +++++++++++++++-- ...FirReservedUnderscoreDeclarationChecker.kt | 31 +++++++----------- .../FirTopLevelTypeAliasChecker.kt | 2 ++ .../expression/FirUnderscoreChecker.kt | 3 ++ .../underscore.fir.kt | 14 ++++---- ...underscoredTypeInForbiddenPositions.fir.kt | 31 ++++++++++++------ .../underscoredTypeInForbiddenPositions.kt | 15 +++++++-- .../underscoredTypeInForbiddenPositions.txt | 14 ++++++-- .../resolve/underscoreInCatchBlock.fir.kt | 2 +- ...scoreInCatchBlockWithEnabledFeature.fir.kt | 2 +- .../p-1/neg/2.1.fir.kt | 32 ------------------- .../decimal-integer-literals/p-1/neg/2.1.kt | 1 + .../p-1/neg/2.2.fir.kt | 32 ------------------- .../decimal-integer-literals/p-1/neg/2.2.kt | 1 + .../p-1/neg/2.3.fir.kt | 32 ------------------- .../decimal-integer-literals/p-1/neg/2.3.kt | 1 + 16 files changed, 103 insertions(+), 140 deletions(-) delete mode 100644 compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.1.fir.kt delete mode 100644 compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.2.fir.kt delete mode 100644 compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.3.fir.kt diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirUnderscoreHelpers.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirUnderscoreHelpers.kt index 1de17431ad8..0d5a57e4a41 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirUnderscoreHelpers.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirUnderscoreHelpers.kt @@ -12,8 +12,9 @@ import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext import org.jetbrains.kotlin.diagnostics.DiagnosticReporter import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors import org.jetbrains.kotlin.diagnostics.reportOn +import org.jetbrains.kotlin.fir.types.* -fun checkUnderscoreDiagnostics( +internal fun checkUnderscoreDiagnostics( source: KtSourceElement?, context: CheckerContext, reporter: DiagnosticReporter, @@ -35,4 +36,29 @@ fun checkUnderscoreDiagnostics( } val CharSequence.isUnderscore: Boolean - get() = all { it == '_' } \ No newline at end of file + get() = all { it == '_' } + +internal fun checkTypeRefForUnderscore( + typeRef: FirTypeRef?, + context: CheckerContext, + reporter: DiagnosticReporter, +) { + if (typeRef is FirErrorTypeRef) return + + typeRef?.forEachQualifierPart { qualifierPart -> + checkUnderscoreDiagnostics(qualifierPart.source, context, reporter, isExpression = true) + + for (typeArgument in qualifierPart.typeArgumentList.typeArguments) { + if (typeArgument is FirTypeProjectionWithVariance) { + checkTypeRefForUnderscore(typeArgument.typeRef, context, reporter) + } else { + checkUnderscoreDiagnostics(typeArgument.source, context, reporter, isExpression = true) + } + } + } +} + +private fun FirTypeRef.forEachQualifierPart(block: (FirQualifierPart) -> Unit) { + val delegatedTypeRef = (this as? FirResolvedTypeRef)?.delegatedTypeRef + (delegatedTypeRef as? FirUserTypeRef)?.qualifier?.forEach(block) +} diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirReservedUnderscoreDeclarationChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirReservedUnderscoreDeclarationChecker.kt index df4fe5f0ebb..c49cf37af1d 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirReservedUnderscoreDeclarationChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirReservedUnderscoreDeclarationChecker.kt @@ -9,25 +9,28 @@ import org.jetbrains.kotlin.KtFakeSourceElementKind import org.jetbrains.kotlin.diagnostics.DiagnosticReporter import org.jetbrains.kotlin.diagnostics.reportOn import org.jetbrains.kotlin.fir.analysis.checkers.SourceNavigator +import org.jetbrains.kotlin.fir.analysis.checkers.checkTypeRefForUnderscore import org.jetbrains.kotlin.fir.analysis.checkers.checkUnderscoreDiagnostics import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext import org.jetbrains.kotlin.fir.analysis.checkers.isUnderscore import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.isCatchParameter -import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef -import org.jetbrains.kotlin.fir.types.FirUserTypeRef import org.jetbrains.kotlin.name.SpecialNames object FirReservedUnderscoreDeclarationChecker : FirBasicDeclarationChecker() { override fun check(declaration: FirDeclaration, context: CheckerContext, reporter: DiagnosticReporter) { if ( declaration is FirRegularClass || - declaration is FirTypeParameter || declaration is FirProperty && declaration.isCatchParameter != true || declaration is FirTypeAlias ) { reportIfUnderscore(declaration, context, reporter) + } else if (declaration is FirTypeParameter) { + reportIfUnderscore(declaration, context, reporter) + declaration.bounds.forEach { + checkTypeRefForUnderscore(it, context, reporter) + } } else if (declaration is FirFunction) { if (declaration is FirSimpleFunction) { reportIfUnderscore(declaration, context, reporter) @@ -72,23 +75,13 @@ object FirReservedUnderscoreDeclarationChecker : FirBasicDeclarationChecker() { } } - val returnOrReceiverTypeRef = when (declaration) { - is FirValueParameter -> declaration.returnTypeRef - is FirFunction -> declaration.receiverParameter?.typeRef - else -> null - } - - if (returnOrReceiverTypeRef is FirResolvedTypeRef) { - val delegatedTypeRef = returnOrReceiverTypeRef.delegatedTypeRef - if (delegatedTypeRef is FirUserTypeRef) { - for (qualifierPart in delegatedTypeRef.qualifier) { - checkUnderscoreDiagnostics(qualifierPart.source, context, reporter, isExpression = true) - - for (typeArgument in qualifierPart.typeArgumentList.typeArguments) { - checkUnderscoreDiagnostics(typeArgument.source, context, reporter, isExpression = true) - } - } + when (declaration) { + is FirValueParameter -> checkTypeRefForUnderscore(declaration.returnTypeRef, context, reporter) + is FirFunction -> { + checkTypeRefForUnderscore(declaration.returnTypeRef, context, reporter) + checkTypeRefForUnderscore(declaration.receiverParameter?.typeRef, context, reporter) } + else -> {} } } } \ No newline at end of file diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelTypeAliasChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelTypeAliasChecker.kt index 9abaebd6803..bb5ec5c6199 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelTypeAliasChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelTypeAliasChecker.kt @@ -9,6 +9,7 @@ import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext import org.jetbrains.kotlin.diagnostics.DiagnosticReporter import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors import org.jetbrains.kotlin.diagnostics.reportOn +import org.jetbrains.kotlin.fir.analysis.checkers.checkTypeRefForUnderscore import org.jetbrains.kotlin.fir.analysis.checkers.isTopLevel import org.jetbrains.kotlin.fir.declarations.FirTypeAlias import org.jetbrains.kotlin.fir.resolve.fullyExpandedType @@ -52,5 +53,6 @@ object FirTopLevelTypeAliasChecker : FirTypeAliasChecker() { context ) } + checkTypeRefForUnderscore(expandedTypeRef, context, reporter) } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirUnderscoreChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirUnderscoreChecker.kt index da40e3e5543..ecf8938ef0d 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirUnderscoreChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirUnderscoreChecker.kt @@ -13,6 +13,7 @@ import org.jetbrains.kotlin.diagnostics.reportOn import org.jetbrains.kotlin.fir.analysis.checkers.isUnderscore import org.jetbrains.kotlin.fir.diagnostics.ConeUnderscoreUsageWithoutBackticks import org.jetbrains.kotlin.fir.expressions.* +import org.jetbrains.kotlin.fir.references.FirErrorNamedReference import org.jetbrains.kotlin.fir.references.toResolvedSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirFunctionSymbol @@ -35,6 +36,8 @@ object FirUnderscoreChecker : FirBasicExpressionChecker() { } private fun diagnosticsCheckNeeded(expression: FirResolvable): Boolean { + if (expression.calleeReference is FirErrorNamedReference) + return false return when (expression) { is FirImplicitInvokeCall -> expression.calleeReference.name.asString().isUnderscore is FirCall -> expression.calleeReference.toResolvedSymbol>()?.callableId?.callableName?.asString()?.isUnderscore == true diff --git a/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/underscore.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/underscore.fir.kt index 6b5913dce8e..8ff97d5ddd4 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/underscore.fir.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/underscore.fir.kt @@ -10,31 +10,31 @@ class C { fun test() { for ((x, _) in C()) { - foo(x, _) + foo(x, _) } for ((_, y) in C()) { - foo(_, y) + foo(_, y) } for ((_, _) in C()) { - foo(_, _) + foo(_, _) } for ((_ : Int, _ : String) in C()) { - foo(_, _) + foo(_, _) } for ((_ : String, _ : Int) in C()) { - foo(_, _) + foo(_, _) } val (x, _) = A() val (_, y) = A() foo(x, y) - foo(x, _) - foo(_, y) + foo(x, _) + foo(_, y) val (`_`, z) = A() diff --git a/compiler/testData/diagnostics/tests/inference/underscoredTypeInForbiddenPositions.fir.kt b/compiler/testData/diagnostics/tests/inference/underscoredTypeInForbiddenPositions.fir.kt index 96f5778df16..12a135acb3e 100644 --- a/compiler/testData/diagnostics/tests/inference/underscoredTypeInForbiddenPositions.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/underscoredTypeInForbiddenPositions.fir.kt @@ -12,23 +12,34 @@ class Bar2_> class Bar3 where K : _ class Bar4<_> -typealias A1<_> = _ +typealias A1<_> = _ +typealias A11<_> = Foo<_> +typealias A12<_> = Foo_>> typealias A2 = Foo<_> typealias A3 = (_) -> T typealias A4 = (T) -> () -> _ typealias A5 = (T) -> (((_))) -> T -fun foo1(x: _) {} -fun foo2(x: Foo<_>) {} +fun foo1(x: _) {} +fun foo2(x: Foo<_>) {} +fun foo21(x: Foo_>>) {} fun foo3(): _ {} -fun foo5(): Foo<_> {} -fun _> foo6(): Foo<_> {} -fun _> foo7(): Foo<_> {} +fun foo4(): Foo<_> {} +fun foo5(): Foo_>> {} +fun _> foo6(): Foo<_> {} +fun _, _> foo7(): _ {} +fun _>, _> foo8(): Foo<_> {} +fun _>>, _> foo9(): Foo_>> {} + +fun _.foo10() {} +fun Foo<_>.foo11() {} +fun Foo_>>.foo12() {} class AA1 : _ class AA2 : Foo<_> -fun <`_`> bar(): Foo<_> = TODO() +fun <`_`> bar(): Foo<_> = TODO() +fun <`_`> bar1(): Foo_>> = TODO() fun test() { val x1 = foo_) -> Unit> { { it } } @@ -42,8 +53,8 @@ fun test() { val z32: Pair<_, Float> = 1 to 1f val z34: Pair<((_)), Float> = 1 to 1f - val x8: (Float) -> Int = { x: _ -> 10 } - val x9: (Foo) -> Int = { x: Foo<_> -> 10 } + val x8: (Float) -> Int = { x: _ -> 10 } + val x9: (Foo) -> Int = { x: Foo<_> -> 10 } val x10 = object : _ {} val x11 = object : Foo<_>() {} @@ -56,7 +67,7 @@ fun test() { val x12: Foo<@_ Int>? = null val x13: Foo<@_() Int>? = null - val x14: Foo<@Anno(_) Int>? = null + val x14: Foo<@Anno(_) Int>? = null val x15: _<_>? = null } diff --git a/compiler/testData/diagnostics/tests/inference/underscoredTypeInForbiddenPositions.kt b/compiler/testData/diagnostics/tests/inference/underscoredTypeInForbiddenPositions.kt index a70dcfef95c..5bea5f7522e 100644 --- a/compiler/testData/diagnostics/tests/inference/underscoredTypeInForbiddenPositions.kt +++ b/compiler/testData/diagnostics/tests/inference/underscoredTypeInForbiddenPositions.kt @@ -13,6 +13,8 @@ class Bar3 where K : _ class Bar4<_> typealias A1<_> = _ +typealias A11<_> = Foo<_> +typealias A12<_> = Foo_>> typealias A2 = Foo<_> typealias A3 = (_) -> T typealias A4 = (T) -> () -> _ @@ -20,15 +22,24 @@ typealias A5 = (T) -> (((_))) -> T fun foo1(x: _) {} fun foo2(x: Foo<_>) {} +fun foo21(x: Foo_>>) {} fun foo3(): _ {} -fun foo5(): Foo<_> {} +fun foo4(): Foo<_> {} +fun foo5(): Foo_>> {} fun _> foo6(): Foo<_> {} -fun _, _> foo7(): Foo<_> {} +fun _, _> foo7(): _ {} +fun _>, _> foo8(): Foo<_> {} +fun _>>, _> foo9(): Foo_>> {} + +fun _.foo10() {} +fun Foo<_>.foo11() {} +fun Foo_>>.foo12() {} class AA1 : _ class AA2 : Foo<_> fun <`_`> bar(): Foo<_> = TODO() +fun <`_`> bar1(): Foo_>> = TODO() fun test() { val x1 = foo_) -> Unit> { { it } } diff --git a/compiler/testData/diagnostics/tests/inference/underscoredTypeInForbiddenPositions.txt b/compiler/testData/diagnostics/tests/inference/underscoredTypeInForbiddenPositions.txt index 0d27978bca4..0a6742d7395 100644 --- a/compiler/testData/diagnostics/tests/inference/underscoredTypeInForbiddenPositions.txt +++ b/compiler/testData/diagnostics/tests/inference/underscoredTypeInForbiddenPositions.txt @@ -1,14 +1,22 @@ package public fun bar(): Foo<_> +public fun bar1(): Foo> public fun foo(/*0*/ x: (K) -> T): kotlin.Pair public fun foo1(/*0*/ x: [Error type: Unresolved type for _]): kotlin.Unit public fun foo2(/*0*/ x: Foo<[Error type: Unresolved type for _]>): kotlin.Unit +public fun foo21(/*0*/ x: Foo>): kotlin.Unit public fun foo3(): [Error type: Unresolved type for _] -public fun foo5(): Foo<[Error type: Unresolved type for _]> +public fun foo4(): Foo<[Error type: Unresolved type for _]> +public fun foo5(): Foo> public fun foo6(): Foo<_> -public fun foo7(): Foo<_> +public fun foo7(): _ +public fun , /*1*/ _> foo8(): Foo<_> +public fun >, /*1*/ _> foo9(): Foo> public fun test(): kotlin.Unit +public fun [Error type: Unresolved type for _].foo10(): kotlin.Unit +public fun Foo<[Error type: Unresolved type for _]>.foo11(): kotlin.Unit +public fun Foo>.foo12(): kotlin.Unit public final class AA1 { public constructor AA1() @@ -74,6 +82,8 @@ public final class Foo { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public typealias A1 = _ +public typealias A11 = Foo<_> +public typealias A12 = Foo> public typealias A2 = Foo<[Error type: Unresolved type for _]> public typealias A3 = ([Error type: Unresolved type for _]) -> T public typealias A4 = (T) -> () -> [Error type: Unresolved type for _] diff --git a/compiler/testData/diagnostics/tests/resolve/underscoreInCatchBlock.fir.kt b/compiler/testData/diagnostics/tests/resolve/underscoreInCatchBlock.fir.kt index cbe03adcd1d..b06ff73b79d 100644 --- a/compiler/testData/diagnostics/tests/resolve/underscoreInCatchBlock.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/underscoreInCatchBlock.fir.kt @@ -29,7 +29,7 @@ fun foo() { } } catch (_: Exception) { `_`.stackTrace - val y1 = _ + val y1 = _ val y2 = (`_`) } try { diff --git a/compiler/testData/diagnostics/tests/resolve/underscoreInCatchBlockWithEnabledFeature.fir.kt b/compiler/testData/diagnostics/tests/resolve/underscoreInCatchBlockWithEnabledFeature.fir.kt index 99b614be4ea..fa55b532d95 100644 --- a/compiler/testData/diagnostics/tests/resolve/underscoreInCatchBlockWithEnabledFeature.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/underscoreInCatchBlockWithEnabledFeature.fir.kt @@ -29,7 +29,7 @@ fun foo() { } } catch (_: Exception) { `_`.stackTrace - val y1 = _ + val y1 = _ val y2 = (`_`) } try { diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.1.fir.kt deleted file mode 100644 index d2cd61e54e7..00000000000 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.1.fir.kt +++ /dev/null @@ -1,32 +0,0 @@ -/* - * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) - * - * SPEC VERSION: 0.1-100 - * MAIN LINK: expressions, constant-literals, integer-literals, decimal-integer-literals -> paragraph 1 -> sentence 2 - * NUMBER: 1 - * DESCRIPTION: Integer literals with an underscore in the first position (it's considered as identifiers). - */ - -// TESTCASE NUMBER: 1 -val value_1 = _5678_90 - -// TESTCASE NUMBER: 2 -val value_2 = _2_3_4_5_6_7_8_9_ - -// TESTCASE NUMBER: 3 -val value_3 = _____________0000 - -// TESTCASE NUMBER: 4 -val value_4 = _______________________________________________________________________________________________________________________________________________________0 - -// TESTCASE NUMBER: 5 -val value_5 = ____________________________________________________ - -// TESTCASE NUMBER: 6 -val value_6 = _ - -// TESTCASE NUMBER: 7 -val value_7 = _0_ - -// TESTCASE NUMBER: 8 -val value_8 = _9_ diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.1.kt index ce0e9cb9533..3bbedc51d33 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.1.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL /* * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) * diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.2.fir.kt deleted file mode 100644 index 80de52dc2c8..00000000000 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.2.fir.kt +++ /dev/null @@ -1,32 +0,0 @@ -/* - * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) - * - * SPEC VERSION: 0.1-100 - * MAIN LINK: expressions, constant-literals, integer-literals, decimal-integer-literals -> paragraph 1 -> sentence 2 - * NUMBER: 2 - * DESCRIPTION: Integer literals with an underscore in the first position (it's considered as identifiers). - */ - -// TESTCASE NUMBER: 1 -val value_1 = _5678_90 - -// TESTCASE NUMBER: 2 -val value_2 = _2_3_4_5_6_7_8_9_ - -// TESTCASE NUMBER: 3 -val value_3 = _____________0000 - -// TESTCASE NUMBER: 4 -val value_4 = _______________________________________________________________________________________________________________________________________________________0 - -// TESTCASE NUMBER: 5 -val value_5 = ____________________________________________________ - -// TESTCASE NUMBER: 6 -val value_6 = _ - -// TESTCASE NUMBER: 7 -val value_7 = _0_ - -// TESTCASE NUMBER: 8 -val value_8 = _9_ diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.2.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.2.kt index b19cbc40afc..fb61c49e215 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.2.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.2.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL /* * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) * diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.3.fir.kt deleted file mode 100644 index 455b178d319..00000000000 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.3.fir.kt +++ /dev/null @@ -1,32 +0,0 @@ -/* - * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) - * - * SPEC VERSION: 0.1-100 - * MAIN LINK: expressions, constant-literals, integer-literals, decimal-integer-literals -> paragraph 1 -> sentence 2 - * NUMBER: 3 - * DESCRIPTION: Integer literals with an underscore in the first position (it's considered as identifiers). - */ - -// TESTCASE NUMBER: 1 -val value_1 = _5678_90 - -// TESTCASE NUMBER: 2 -val value_2 = _2_3_4_5_6_7_8_9_ - -// TESTCASE NUMBER: 3 -val value_3 = _____________0000 - -// TESTCASE NUMBER: 4 -val value_4 = _______________________________________________________________________________________________________________________________________________________0 - -// TESTCASE NUMBER: 5 -val value_5 = ____________________________________________________ - -// TESTCASE NUMBER: 6 -val value_6 = _ - -// TESTCASE NUMBER: 7 -val value_7 = _0_ - -// TESTCASE NUMBER: 8 -val value_8 = _9_ diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.3.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.3.kt index 3ecab1cd6d8..e359503bf8a 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.3.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.3.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL /* * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) *