diff --git a/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java b/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java index 633632c57046e94229fafc119197d00dc7891cde..18e275d1142e811be275beee5d1aee1fa65e938b 100644 --- a/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java +++ b/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java @@ -1231,6 +1231,24 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract public void testValOnAnnotationParameter() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/valOnAnnotationParameter.kt"); } + + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class FunctionAsExpression extends AbstractLazyBodyIsNotTouchedTilContractsPhaseTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInFunctionAsExpression() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("Parameters.kt") + public void testParameters() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.kt"); + } + } } @TestMetadata("compiler/fir/analysis-tests/testData/resolve/expresssions") diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.fir.txt new file mode 100644 index 0000000000000000000000000000000000000000..ca542e88a5480b0e89c3f9a5beaa52e4e9b164db --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.fir.txt @@ -0,0 +1,45 @@ +FILE: Parameters.kt + public final val bar: R|(kotlin/Int) -> kotlin/Unit| = fun (p: R|kotlin/Int| = Int(3)): R|kotlin/Unit| { + } + + public get(): R|(kotlin/Int) -> kotlin/Unit| + public final val bas: R|(kotlin/Int) -> kotlin/Unit| = fun (vararg p: R|kotlin/Int|): R|kotlin/Unit| { + } + + public get(): R|(kotlin/Int) -> kotlin/Unit| + public final fun gar(): R|(kotlin/Int) -> kotlin/Unit| { + ^gar fun (p: R|kotlin/Int| = Int(3)): R|kotlin/Unit| { + } + + } + public final fun gas(): R|(kotlin/Int) -> kotlin/Unit| { + ^gas fun (vararg p: R|kotlin/Int|): R|kotlin/Unit| { + } + + } + public final fun outer(b: R|kotlin/Any?|): R|kotlin/Unit| { + lval bar: R|(kotlin/Int) -> kotlin/Unit| = fun (p: R|kotlin/Int| = Int(3)): R|kotlin/Unit| { + } + + lval bas: R|(kotlin/Int) -> kotlin/Unit| = fun (vararg p: R|kotlin/Int|): R|kotlin/Unit| { + } + + local final fun gar(): R|(kotlin/Int) -> kotlin/Unit| { + ^gar fun (p: R|kotlin/Int| = Int(3)): R|kotlin/Unit| { + } + + } + + local final fun gas(): R|(kotlin/Int) -> kotlin/Unit| { + ^gas fun (vararg p: R|kotlin/Int|): R|kotlin/Unit| { + } + + } + + R|/outer|(fun (p: R|kotlin/Int| = Int(3)): R|kotlin/Unit| { + } + ) + R|/outer|(fun (vararg p: R|kotlin/Int|): R|kotlin/Unit| { + } + ) + } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.kt new file mode 100644 index 0000000000000000000000000000000000000000..710f7c2dd2ff193414e4b71fc27935cf33ff5786 --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.kt @@ -0,0 +1,16 @@ +val bar = fun(p: Int = 3) {} +val bas = fun(vararg p: Int) {} + +fun gar() = fun(p: Int = 3) {} +fun gas() = fun(vararg p: Int) {} + +fun outer(b: Any?) { + val bar = fun(p: Int = 3) {} + val bas = fun(vararg p: Int) {} + + fun gar() = fun(p: Int = 3) {} + fun gas() = fun(vararg p: Int) {} + + outer(fun(p: Int = 3) {}) + outer(fun(vararg p: Int) {}) +} diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java index be352eaf06cd5defb67e09cbb545a928af28a6bb..0a8480423e5f76e683462f4f3b5be0a698a5a6ed 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java @@ -1424,6 +1424,22 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest { public void testValOnAnnotationParameter() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/valOnAnnotationParameter.kt"); } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression") + @TestDataPath("$PROJECT_ROOT") + public class FunctionAsExpression extends AbstractFirDiagnosticTest { + @Test + public void testAllFilesPresentInFunctionAsExpression() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("Parameters.kt") + public void testParameters() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.kt"); + } + } } @Nested diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java index d89ea750310e8647830eaca1803c569c8e23ef9d..2f11cbd2a33fb6e2b66529936d7226e0e8a2672a 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java @@ -1433,6 +1433,23 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos public void testValOnAnnotationParameter() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/valOnAnnotationParameter.kt"); } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class FunctionAsExpression extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInFunctionAsExpression() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("Parameters.kt") + public void testParameters() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.kt"); + } + } } @Nested diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirAnonymousFunctionChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirAnonymousFunctionChecker.kt new file mode 100644 index 0000000000000000000000000000000000000000..6b78f9131219613b39efaa6cabe7192ca6559331 --- /dev/null +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirAnonymousFunctionChecker.kt @@ -0,0 +1,30 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.analysis.checkers.expression + +import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext +import org.jetbrains.kotlin.fir.analysis.checkers.extended.report +import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors +import org.jetbrains.kotlin.fir.declarations.FirAnonymousFunction +import org.jetbrains.kotlin.fir.expressions.FirStatement + +object FirAnonymousFunctionChecker : FirExpressionChecker() { + override fun check(expression: FirStatement, context: CheckerContext, reporter: DiagnosticReporter) { + if (expression !is FirAnonymousFunction) { + return + } + for (valueParameter in expression.valueParameters) { + val source = valueParameter.source ?: continue + if (valueParameter.defaultValue != null) { + reporter.report(source, FirErrors.ANONYMOUS_FUNCTION_PARAMETER_WITH_DEFAULT_VALUE) + } + if (valueParameter.isVararg) { + reporter.report(source, FirErrors.USELESS_VARARG_ON_PARAMETER) + } + } + } +} diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ExpressionCheckersDiagnosticComponent.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ExpressionCheckersDiagnosticComponent.kt index 4931bac1e112bcd36ebc08202fd6a039291cef15..8f737d238622180b2283728fa2a0764feb605475 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ExpressionCheckersDiagnosticComponent.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ExpressionCheckersDiagnosticComponent.kt @@ -10,11 +10,16 @@ import org.jetbrains.kotlin.fir.analysis.checkers.expression.FirExpressionChecke import org.jetbrains.kotlin.fir.analysis.checkersComponent import org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollector import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter +import org.jetbrains.kotlin.fir.declarations.FirAnonymousFunction import org.jetbrains.kotlin.fir.expressions.* class ExpressionCheckersDiagnosticComponent(collector: AbstractDiagnosticCollector) : AbstractDiagnosticCollectorComponent(collector) { private val checkers = session.checkersComponent.expressionCheckers + override fun visitAnonymousFunction(anonymousFunction: FirAnonymousFunction, data: CheckerContext) { + checkers.basicExpressionCheckers.check(anonymousFunction, data, reporter) + } + override fun visitTypeOperatorCall(typeOperatorCall: FirTypeOperatorCall, data: CheckerContext) { checkers.basicExpressionCheckers.check(typeOperatorCall, data, reporter) } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt index 3b40846d9aec5e6e6aadd1299cf90f4caa29d0a0..04f2c9863362768836e4ea7c7a63c3eed90506e8 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt @@ -26,6 +26,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ABSTRACT_SUPER_CA import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.AMBIGUITY import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ANNOTATION_CLASS_MEMBER import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ANNOTATION_PARAMETER_DEFAULT_VALUE_MUST_BE_CONSTANT +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ANONYMOUS_FUNCTION_PARAMETER_WITH_DEFAULT_VALUE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ANY_METHOD_IMPLEMENTED_IN_INTERFACE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ARRAY_EQUALITY_OPERATOR_CAN_BE_REPLACED_WITH_EQUALS import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ASSIGNED_VALUE_IS_NEVER_READ @@ -133,6 +134,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNRESOLVED_LABEL import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNRESOLVED_REFERENCE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNUSED_VARIABLE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UPPER_BOUND_VIOLATED +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.USELESS_VARARG_ON_PARAMETER import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.VARIABLE_EXPECTED import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.VARIABLE_INITIALIZER_IS_REDUNDANT import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.VARIABLE_NEVER_READ @@ -360,6 +362,12 @@ class FirDefaultErrorMessages : DefaultErrorMessages.Extension { map.put(FUNCTION_DECLARATION_WITH_NO_NAME, "Function declaration must have a name") + map.put( + ANONYMOUS_FUNCTION_PARAMETER_WITH_DEFAULT_VALUE, + "An anonymous function is not allowed to specify default values for its parameters" + ) + map.put(USELESS_VARARG_ON_PARAMETER, "Vararg on this parameter is useless") + // Properties & accessors map.put( ABSTRACT_PROPERTY_IN_NON_ABSTRACT_CLASS, diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt index 6f9c6108c03746414d123873eef35f09846cf4bd..ad2406f1548b8a50c2500ab421fbe699a9047791 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt @@ -158,6 +158,10 @@ object FirErrors { val FUNCTION_DECLARATION_WITH_NO_NAME by error0(SourceElementPositioningStrategies.DECLARATION_SIGNATURE) + // TODO: val ANONYMOUS_FUNCTION_WITH_NAME by error1(SourceElementPositioningStrategies.DECLARATION_NAME) + val ANONYMOUS_FUNCTION_PARAMETER_WITH_DEFAULT_VALUE by error0(SourceElementPositioningStrategies.PARAMETER_DEFAULT_VALUE) + val USELESS_VARARG_ON_PARAMETER by warning0() + // Properties & accessors val ABSTRACT_PROPERTY_IN_NON_ABSTRACT_CLASS by error2(SourceElementPositioningStrategies.MODALITY_MODIFIER) val PRIVATE_PROPERTY_IN_INTERFACE by error0(SourceElementPositioningStrategies.VISIBILITY_MODIFIER) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt index f288784a41edea96859dd6b1d48f02326831cb79..daf1f7e374e9798b472c06a04a7e2ebfc1fbb458 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt @@ -247,6 +247,30 @@ object LightTreePositioningStrategies { return markElement(tree.operationReference(node) ?: node, startOffset, endOffset, tree, node) } } + + val PARAMETER_DEFAULT_VALUE: LightTreePositioningStrategy = object : LightTreePositioningStrategy() { + override fun mark( + node: LighterASTNode, + startOffset: Int, + endOffset: Int, + tree: FlyweightCapableTreeStructure + ): List { + val defaultValueElement = tree.defaultValue(node) ?: node + return markElement(defaultValueElement, startOffset, endOffset, tree, node) + } + } + + val PARAMETER_VARARG_MODIFIER: LightTreePositioningStrategy = object : LightTreePositioningStrategy() { + override fun mark( + node: LighterASTNode, + startOffset: Int, + endOffset: Int, + tree: FlyweightCapableTreeStructure + ): List { + val modifier = tree.modifierList(node)?.let { modifierList -> tree.findChildByType(modifierList, KtTokens.VARARG_KEYWORD) } + return markElement(modifier ?: node, startOffset, endOffset, tree, node) + } + } } fun FirSourceElement.hasValOrVar(): Boolean = @@ -317,6 +341,20 @@ private fun FlyweightCapableTreeStructure.receiverTypeReference( } } +private fun FlyweightCapableTreeStructure.defaultValue(node: LighterASTNode): LighterASTNode? { + val childrenRef = Ref>() + getChildren(node, childrenRef) + // p : T = v + return childrenRef.get()?.reversed()?.firstOrNull { + it != null && + it.tokenType != KtTokens.WHITE_SPACE && + it.tokenType != KtTokens.EQ && + it.tokenType != KtNodeTypes.TYPE_REFERENCE && + it.tokenType != KtTokens.COLON && + it.tokenType != KtTokens.IDENTIFIER + } +} + fun FlyweightCapableTreeStructure.findChildByType(node: LighterASTNode, type: IElementType): LighterASTNode? { val childrenRef = Ref>() getChildren(node, childrenRef) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt index 97d1c6e463ee239c0732269734d35f9e939aed5a..deb902c645707ab5cb2d4a6511ac4998998e79fa 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt @@ -52,4 +52,14 @@ object SourceElementPositioningStrategies { LightTreePositioningStrategies.OPERATOR, PositioningStrategies.OPERATOR ) + + val PARAMETER_DEFAULT_VALUE = SourceElementPositioningStrategy( + LightTreePositioningStrategies.PARAMETER_DEFAULT_VALUE, + PositioningStrategies.PARAMETER_DEFAULT_VALUE + ) + + val PARAMETER_VARARG_MODIFIER = SourceElementPositioningStrategy( + LightTreePositioningStrategies.PARAMETER_VARARG_MODIFIER, + PositioningStrategies.PARAMETER_VARARG_MODIFIER + ) } \ No newline at end of file diff --git a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonExpressionCheckers.kt b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonExpressionCheckers.kt index bde2a98848a8d16b4186f6ae48df21fc43b33020..f93b89239f34eff7838768fca9ad633fb325b679 100644 --- a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonExpressionCheckers.kt +++ b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonExpressionCheckers.kt @@ -8,6 +8,10 @@ package org.jetbrains.kotlin.fir.checkers import org.jetbrains.kotlin.fir.analysis.checkers.expression.* object CommonExpressionCheckers : ExpressionCheckers() { + override val basicExpressionCheckers: Set = setOf( + FirAnonymousFunctionChecker, + ) + override val qualifiedAccessCheckers: Set = setOf( FirSuperNotAvailableChecker, FirNotASupertypeChecker, diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/Parameters.fir.kt b/compiler/testData/diagnostics/tests/functionAsExpression/Parameters.fir.kt deleted file mode 100644 index 1b8ccc2cd788dce18288c8d344e6857ee65e96b7..0000000000000000000000000000000000000000 --- a/compiler/testData/diagnostics/tests/functionAsExpression/Parameters.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER -UNUSED_VARIABLE - -val bar = fun(p: Int = 3) {} -val bas = fun(vararg p: Int) {} - -fun gar() = fun(p: Int = 3) {} -fun gas() = fun(vararg p: Int) {} - -fun outer(b: Any?) { - val bar = fun(p: Int = 3) {} - val bas = fun(vararg p: Int) {} - - fun gar() = fun(p: Int = 3) {} - fun gas() = fun(vararg p: Int) {} - - outer(fun(p: Int = 3) {}) - outer(fun(vararg p: Int) {}) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/Parameters.kt b/compiler/testData/diagnostics/tests/functionAsExpression/Parameters.kt index c5e7c90ab39381c47500f249a8b64718e9b5e399..b748c811c6c15e8ff652da9e8ed77608dc0b9be2 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/Parameters.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/Parameters.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER -UNUSED_VARIABLE val bar = fun(p: Int = 3) {} diff --git a/compiler/testData/diagnostics/tests/inlineClasses/varargsOnParametersOfInlineClassType.fir.kt b/compiler/testData/diagnostics/tests/inlineClasses/varargsOnParametersOfInlineClassType.fir.kt index a6faedc90edb89079e271fbcde3a7298df2a421e..b7978e5bf6001dc4fbb061319e46dfb8b9b716b6 100644 --- a/compiler/testData/diagnostics/tests/inlineClasses/varargsOnParametersOfInlineClassType.fir.kt +++ b/compiler/testData/diagnostics/tests/inlineClasses/varargsOnParametersOfInlineClassType.fir.kt @@ -10,7 +10,7 @@ class A { fun f3(a0: Int, vararg a1: Foo) { fun f4(vararg a: Foo) {} - val g = fun (vararg v: Foo) {} + val g = fun (vararg v: Foo) {} } } diff --git a/compiler/testData/diagnostics/tests/valueClasses/varargsOnParametersOfValueClassType.fir.kt b/compiler/testData/diagnostics/tests/valueClasses/varargsOnParametersOfValueClassType.fir.kt index 91fa32f9b9bf10c410a80c1a34f7d1de7bba161f..062857e9b71488c05cb3a29704d2910c079432f3 100644 --- a/compiler/testData/diagnostics/tests/valueClasses/varargsOnParametersOfValueClassType.fir.kt +++ b/compiler/testData/diagnostics/tests/valueClasses/varargsOnParametersOfValueClassType.fir.kt @@ -16,7 +16,7 @@ class A { fun f3(a0: Int, vararg a1: Foo) { fun f4(vararg a: Foo) {} - val g = fun (vararg v: Foo) {} + val g = fun (vararg v: Foo) {} } }