diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/checkers/declarationCheckers.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/checkers/declarationCheckers.kt index b2fd217fe67..f72645f2009 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/checkers/declarationCheckers.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/checkers/declarationCheckers.kt @@ -58,7 +58,10 @@ public class PlatformStaticAnnotationChecker : DeclarationChecker { bindingContext: BindingContext ) { if (descriptor.hasJvmStaticAnnotation()) { - if (declaration is KtNamedFunction || declaration is KtProperty || declaration is KtPropertyAccessor) { + if (declaration is KtNamedFunction || + declaration is KtProperty || + declaration is KtPropertyAccessor || + declaration is KtParameter) { checkDeclaration(declaration, descriptor, diagnosticHolder) } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/constructorProperty.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/constructorProperty.kt new file mode 100644 index 00000000000..a0c43bfa77e --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/constructorProperty.kt @@ -0,0 +1,3 @@ +class A(@JvmStatic val z: Int) { + +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/constructorProperty.txt b/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/constructorProperty.txt new file mode 100644 index 00000000000..19fd82d8c64 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/constructorProperty.txt @@ -0,0 +1,9 @@ +package + +public final class A { + public constructor A(/*0*/ z: kotlin.Int) + @kotlin.jvm.JvmStatic() public final val z: kotlin.Int + 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/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java index f45f25ad3b4..7190599f7c7 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java @@ -501,6 +501,12 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic"), Pattern.compile("^(.+)\\.kt$"), true); } + @TestMetadata("constructorProperty.kt") + public void testConstructorProperty() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/constructorProperty.kt"); + doTest(fileName); + } + @TestMetadata("constructors.kt") public void testConstructors() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/constructors.kt");