diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java index 6752513f454..8faa90b2ec9 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java @@ -1822,6 +1822,47 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac } } + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/annotations/typeUse") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class TypeUse { + @Test + public void testAllFilesPresentInTypeUse() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/annotations/typeUse"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @Test + @TestMetadata("kt19455.kt") + public void testKt19455() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/typeUse/kt19455.kt"); + } + + @Test + @TestMetadata("kt25876.kt") + public void testKt25876() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/typeUse/kt25876.kt"); + } + + @Test + @TestMetadata("kt46173.kt") + public void testKt46173() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/typeUse/kt46173.kt"); + } + + @Test + @TestMetadata("kt8325.kt") + public void testKt8325() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/typeUse/kt8325.kt"); + } + + @Test + @TestMetadata("nonTypeUseAnnotationOnType.kt") + public void testNonTypeUseAnnotationOnType() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/typeUse/nonTypeUseAnnotationOnType.kt"); + } + } + @Nested @TestMetadata("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget") @TestDataPath("$PROJECT_ROOT") @@ -4267,6 +4308,18 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac runTest("compiler/testData/diagnostics/tests/classObjects/resolveFunctionInsideClassObject.kt"); } + @Test + @TestMetadata("selfCallsInCompanionSuperConstructor_error.kt") + public void testSelfCallsInCompanionSuperConstructor_error() throws Exception { + runTest("compiler/testData/diagnostics/tests/classObjects/selfCallsInCompanionSuperConstructor_error.kt"); + } + + @Test + @TestMetadata("selfCallsInCompanionSuperConstructor_warning.kt") + public void testSelfCallsInCompanionSuperConstructor_warning() throws Exception { + runTest("compiler/testData/diagnostics/tests/classObjects/selfCallsInCompanionSuperConstructor_warning.kt"); + } + @Test @TestMetadata("typeParametersInAnnonymousObject.kt") public void testTypeParametersInAnnonymousObject() throws Exception { @@ -19249,6 +19302,18 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac runTest("compiler/testData/diagnostics/tests/numbers/literalReceiverWithIntegerValueType.kt"); } + @Test + @TestMetadata("newLiteralOperatorsResolution_newResolve.kt") + public void testNewLiteralOperatorsResolution_newResolve() throws Exception { + runTest("compiler/testData/diagnostics/tests/numbers/newLiteralOperatorsResolution_newResolve.kt"); + } + + @Test + @TestMetadata("newLiteralOperatorsResolution_warning.kt") + public void testNewLiteralOperatorsResolution_warning() throws Exception { + runTest("compiler/testData/diagnostics/tests/numbers/newLiteralOperatorsResolution_warning.kt"); + } + @Test @TestMetadata("numberAsUnionAndIntersection.kt") public void testNumberAsUnionAndIntersection() throws Exception { @@ -31216,6 +31281,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac runTest("compiler/testData/diagnostics/testsWithStdLib/implicitCastToAny.kt"); } + @Test + @TestMetadata("implicitNothingInDelegate.kt") + public void testImplicitNothingInDelegate() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/implicitNothingInDelegate.kt"); + } + @Test @TestMetadata("InaccessibleInternalClass.kt") public void testInaccessibleInternalClass() throws Exception { @@ -32748,6 +32819,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac runTest("compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/compositions.kt"); } + @Test + @TestMetadata("contractWithDeepGenerics.kt") + public void testContractWithDeepGenerics() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/contractWithDeepGenerics.kt"); + } + @Test @TestMetadata("contractsOnMembers.kt") public void testContractsOnMembers() throws Exception { @@ -34044,6 +34121,23 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac } } + @Nested + @TestMetadata("compiler/testData/diagnostics/testsWithStdLib/evaluate") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Evaluate { + @Test + public void testAllFilesPresentInEvaluate() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/evaluate"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @Test + @TestMetadata("charCodeExpType.kt") + public void testCharCodeExpType() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/evaluate/charCodeExpType.kt"); + } + } + @Nested @TestMetadata("compiler/testData/diagnostics/testsWithStdLib/experimental") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/DiagnosticData.kt b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/DiagnosticData.kt index f3a12b92a79..2d55225ab52 100644 --- a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/DiagnosticData.kt +++ b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/DiagnosticData.kt @@ -62,6 +62,7 @@ enum class PositioningStrategy(private val strategy: String? = null) { FLOAT_LITERAL_OUT_OF_RANGE, LONG_LITERAL_SUFFIX, REIFIED_MODIFIER, + TYPE_PARAMETERS_LIST, ; diff --git a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt index 55e595f7bdd..ad6ac6c36cf 100644 --- a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt +++ b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt @@ -338,7 +338,7 @@ object DIAGNOSTICS_LIST : DiagnosticList() { val REIFIED_TYPE_PARAMETER_NO_INLINE by error(PositioningStrategy.REIFIED_MODIFIER) - val TYPE_PARAMETERS_NOT_ALLOWED by error() + val TYPE_PARAMETERS_NOT_ALLOWED by error(PositioningStrategy.TYPE_PARAMETERS_LIST) val TYPE_PARAMETER_OF_PROPERTY_NOT_USED_IN_RECEIVER by error() @@ -349,7 +349,7 @@ object DIAGNOSTICS_LIST : DiagnosticList() { val CYCLIC_GENERIC_UPPER_BOUND by error() - val DEPRECATED_TYPE_PARAMETER_SYNTAX by error() + val DEPRECATED_TYPE_PARAMETER_SYNTAX by error(PositioningStrategy.TYPE_PARAMETERS_LIST) val MISPLACED_TYPE_PARAMETER_CONSTRAINTS by warning() diff --git a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt index 377452bb95a..5aea44cef15 100644 --- a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt +++ b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt @@ -245,11 +245,11 @@ object FirErrors { val NAME_IN_CONSTRAINT_IS_NOT_A_TYPE_PARAMETER by error2() val BOUND_ON_TYPE_ALIAS_PARAMETER_NOT_ALLOWED by error0() val REIFIED_TYPE_PARAMETER_NO_INLINE by error0(SourceElementPositioningStrategies.REIFIED_MODIFIER) - val TYPE_PARAMETERS_NOT_ALLOWED by error0() + val TYPE_PARAMETERS_NOT_ALLOWED by error0(SourceElementPositioningStrategies.TYPE_PARAMETERS_LIST) val TYPE_PARAMETER_OF_PROPERTY_NOT_USED_IN_RECEIVER by error0() val RETURN_TYPE_MISMATCH by error2(SourceElementPositioningStrategies.WHOLE_ELEMENT) val CYCLIC_GENERIC_UPPER_BOUND by error0() - val DEPRECATED_TYPE_PARAMETER_SYNTAX by error0() + val DEPRECATED_TYPE_PARAMETER_SYNTAX by error0(SourceElementPositioningStrategies.TYPE_PARAMETERS_LIST) val MISPLACED_TYPE_PARAMETER_CONSTRAINTS by warning0() val DYNAMIC_UPPER_BOUND by error0() diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirFunctionTypeParametersChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirFunctionTypeParametersChecker.kt index 9f4264fba67..d315b00160f 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirFunctionTypeParametersChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirFunctionTypeParametersChecker.kt @@ -21,7 +21,7 @@ object FirFunctionTypeParametersChecker : FirSimpleFunctionChecker() { val nameNode = source.treeStructure.nameIdentifier(source.lighterASTNode) if (typeParamsNode != null && nameNode != null && typeParamsNode.startOffset > nameNode.startOffset) { reporter.reportOn( - typeParamsNode.toFirLightSourceElement(source.treeStructure), + source, FirErrors.DEPRECATED_TYPE_PARAMETER_SYNTAX, context ) 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 index bc58da7a650..75481e69a4a 100644 --- 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 @@ -35,9 +35,9 @@ object FirAnonymousFunctionChecker : FirExpressionChecker() { context: CheckerContext ) { val source = expression.source ?: return - source.treeStructure.typeParametersList(source.lighterASTNode)?.let { typeParamsNode -> + source.treeStructure.typeParametersList(source.lighterASTNode)?.let { _ -> reporter.reportOn( - typeParamsNode.toFirLightSourceElement(source.treeStructure), + source, FirErrors.TYPE_PARAMETERS_NOT_ALLOWED, context ) 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 3bbe85c3062..81b5b5bdee3 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 @@ -19,6 +19,7 @@ import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.lexer.KtTokens.MODALITY_MODIFIERS import org.jetbrains.kotlin.lexer.KtTokens.VISIBILITY_MODIFIERS import org.jetbrains.kotlin.psi.KtParameter.VAL_VAR_TOKEN_SET +import org.jetbrains.kotlin.psi.psiUtil.endOffset import org.jetbrains.kotlin.psi.stubs.elements.KtConstantExpressionElementType import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult @@ -267,7 +268,7 @@ object LightTreePositioningStrategies { endOffset: Int, tree: FlyweightCapableTreeStructure ): List { - val value = tree.lastChild(node) ?: node + val value = node.nonFillerLastChildOrSelf(tree) return markElement(value, startOffset, endOffset, tree, node) } } @@ -573,10 +574,32 @@ object LightTreePositioningStrategies { val WHOLE_ELEMENT = object : LightTreePositioningStrategy() { } val LONG_LITERAL_SUFFIX = object : LightTreePositioningStrategy() { + override fun mark( + node: LighterASTNode, + startOffset: Int, + endOffset: Int, + tree: FlyweightCapableTreeStructure + ): List { + if (node.tokenType == KtNodeTypes.INTEGER_CONSTANT) { + return listOf(TextRange.create(endOffset - 1, endOffset)) + } + return super.mark(node, startOffset, endOffset, tree) + } } val REIFIED_MODIFIER: LightTreePositioningStrategy = ModifierSetBasedLightTreePositioningStrategy(TokenSet.create(KtTokens.REIFIED_KEYWORD)) + + val TYPE_PARAMETERS_LIST: LightTreePositioningStrategy = object : LightTreePositioningStrategy() { + override fun mark( + node: LighterASTNode, + startOffset: Int, + endOffset: Int, + tree: FlyweightCapableTreeStructure + ): List { + return markElement(tree.typeParametersList(node) ?: node, startOffset, endOffset, tree, node) + } + } } fun FirSourceElement.hasValOrVar(): Boolean = @@ -809,7 +832,7 @@ private fun FlyweightCapableTreeStructure.firstChild(node: Light } private fun FlyweightCapableTreeStructure.lastChild(node: LighterASTNode): LighterASTNode? { - val childrenRef = Ref>() + val childrenRef = Ref>() getChildren(node, childrenRef) - return childrenRef.get().lastOrNull() + return childrenRef.get().lastOrNull { it != null } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategy.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategy.kt index 9b2a7c3ee6e..5714074a6ca 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategy.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategy.kt @@ -69,7 +69,7 @@ private val FILLER_TOKENS = setOf( private fun LighterASTNode.nonFillerFirstChildOrSelf(tree: FlyweightCapableTreeStructure): LighterASTNode = getChildren(tree).firstOrNull { it != null && it.tokenType !in FILLER_TOKENS } ?: this -private fun LighterASTNode.nonFillerLastChildOrSelf(tree: FlyweightCapableTreeStructure): LighterASTNode = +internal fun LighterASTNode.nonFillerLastChildOrSelf(tree: FlyweightCapableTreeStructure): LighterASTNode = getChildren(tree).lastOrNull { it != null && it.tokenType !in FILLER_TOKENS } ?: this 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 59adff1b4fd..d17059acd72 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 @@ -202,4 +202,9 @@ object SourceElementPositioningStrategies { LightTreePositioningStrategies.REIFIED_MODIFIER, PositioningStrategies.REIFIED_MODIFIER ) + + val TYPE_PARAMETERS_LIST = SourceElementPositioningStrategy( + LightTreePositioningStrategies.TYPE_PARAMETERS_LIST, + PositioningStrategies.TYPE_PARAMETERS_LIST + ) } diff --git a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt index b7d5db01aab..d4232082652 100644 --- a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt +++ b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt @@ -671,25 +671,26 @@ class ExpressionsConverter( usedAsExpression = whenExpression.usedAsExpression for (entry in whenEntries) { val branch = entry.firBlock + val entrySource = entry.node.toFirSourceElement() branches += if (!entry.isElse) { if (hasSubject) { val firCondition = entry.toFirWhenCondition() buildWhenBranch { - source = branch.source + source = entrySource condition = firCondition result = branch } } else { val firCondition = entry.toFirWhenConditionWithoutSubject() buildWhenBranch { - source = branch.source + source = entrySource condition = firCondition result = branch } } } else { buildWhenBranch { - source = branch.source + source = entrySource condition = buildElseIfTrueCondition() result = branch } @@ -721,7 +722,7 @@ class ExpressionsConverter( } } - return WhenEntry(conditions, firBlock, isElse) + return WhenEntry(conditions, firBlock, whenEntry, isElse) } private fun convertWhenConditionExpression(whenCondition: LighterASTNode, whenRefWithSubject: FirExpressionRef?): FirExpression { @@ -1179,7 +1180,9 @@ class ExpressionsConverter( */ private fun convertReturn(returnExpression: LighterASTNode): FirExpression { var labelName: String? = null - var firExpression: FirExpression = buildUnitExpression() + var firExpression: FirExpression = buildUnitExpression { + source = returnExpression.toFirSourceElement(FirFakeSourceElementKind.ImplicitUnit) + } returnExpression.forEachChildren { when (it.tokenType) { LABEL_QUALIFIER -> labelName = it.getAsStringWithoutBacktick().replace("@", "") diff --git a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/fir/WhenEntry.kt b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/fir/WhenEntry.kt index d9373ec74f2..b5fae30afd1 100644 --- a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/fir/WhenEntry.kt +++ b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/fir/WhenEntry.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.fir.lightTree.fir +import com.intellij.lang.LighterASTNode import org.jetbrains.kotlin.fir.builder.generateLazyLogicalOperation import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind import org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic @@ -15,6 +16,7 @@ import org.jetbrains.kotlin.fir.expressions.buildErrorExpression data class WhenEntry( val conditions: List, val firBlock: FirBlock, + val node: LighterASTNode, val isElse: Boolean = false ) { fun toFirWhenCondition(): FirExpression { @@ -39,4 +41,4 @@ data class WhenEntry( else -> condition } } -} \ No newline at end of file +} diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt index 21ae87d4a4a..24de0c82722 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt @@ -790,6 +790,15 @@ object PositioningStrategies { val WHOLE_ELEMENT: PositioningStrategy = object : PositioningStrategy() {} + val TYPE_PARAMETERS_LIST: PositioningStrategy = object : PositioningStrategy() { + override fun mark(element: KtDeclaration): List { + if (element is KtTypeParameterListOwner) { + return markElement(element.typeParameterList ?: element) + } + return markElement(element) + } + } + /** * @param locateReferencedName whether to remove any nested parentheses while locating the reference element. This is useful for diff --git a/compiler/testData/diagnostics/tests/annotations/kt1860-negative.fir.kt b/compiler/testData/diagnostics/tests/annotations/kt1860-negative.fir.kt index ab8959e75ae..1eff500f804 100644 --- a/compiler/testData/diagnostics/tests/annotations/kt1860-negative.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/kt1860-negative.fir.kt @@ -4,7 +4,7 @@ fun foo(@varargs f : Int) {} var bar : Int = 1 set(@varargs v) {} -val x : (Int) -> Int = {@varargs x : Int -> x} +val x : (Int) -> Int = {@varargs x : Int -> x} class Hello(@varargs args: Any) { } diff --git a/compiler/testData/diagnostics/tests/annotations/kt1860-positive.fir.kt b/compiler/testData/diagnostics/tests/annotations/kt1860-positive.fir.kt index ce6384ae9e7..311ce46913a 100644 --- a/compiler/testData/diagnostics/tests/annotations/kt1860-positive.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/kt1860-positive.fir.kt @@ -8,7 +8,7 @@ fun foo(@test f : Int) {} var bar : Int = 1 set(@test v) {} -val x : (Int) -> Int = {@test x : Int -> x} // todo fix parser annotation on lambda parameter +val x : (Int) -> Int = {@test x : Int -> x} // todo fix parser annotation on lambda parameter class Hello(@test args: Any) { }