diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt
index 7c6ae523ae1..7ece5f6e45c 100644
--- a/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt
+++ b/idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt
@@ -74,10 +74,11 @@ class UnusedSymbolInspection : AbstractKotlinInspection() {
val lightElement: PsiElement? = when (declaration) {
is KtClassOrObject -> declaration.toLightClass()
is KtNamedFunction, is KtSecondaryConstructor -> LightClassUtil.getLightClassMethod(declaration as KtFunction)
- is KtProperty -> {
+ is KtProperty, is KtParameter -> {
+ if (declaration is KtParameter && !declaration.hasValOrVar()) return false
// can't rely on light element, check annotation ourselves
val descriptor = declaration.descriptor ?: return false
- val entryPointsManager = EntryPointsManager.getInstance(declaration.getProject()) as EntryPointsManagerBase
+ val entryPointsManager = EntryPointsManager.getInstance(declaration.project) as EntryPointsManagerBase
return checkAnnotatedUsingPatterns(
descriptor,
entryPointsManager.additionalAnnotations + entryPointsManager.ADDITIONAL_ANNOTATIONS
diff --git a/idea/testData/inspections/unusedSymbol/property/inspectionData/expected.xml b/idea/testData/inspections/unusedSymbol/property/inspectionData/expected.xml
index 8d6867e69aa..f920e8411e5 100644
--- a/idea/testData/inspections/unusedSymbol/property/inspectionData/expected.xml
+++ b/idea/testData/inspections/unusedSymbol/property/inspectionData/expected.xml
@@ -25,4 +25,13 @@
Unused Symbol
Property 'unused' is never used
+
+
+ unusedButEntryPointAnnotated.kt
+ 4
+ light_idea_test_case
+
+ Unused symbol
+ Class 'Owner' is never used
+
diff --git a/idea/testData/inspections/unusedSymbol/property/unusedButEntryPointAnnotated.kt b/idea/testData/inspections/unusedSymbol/property/unusedButEntryPointAnnotated.kt
index 5a64001b77c..9d67609720a 100644
--- a/idea/testData/inspections/unusedSymbol/property/unusedButEntryPointAnnotated.kt
+++ b/idea/testData/inspections/unusedSymbol/property/unusedButEntryPointAnnotated.kt
@@ -1,2 +1,6 @@
@test.anno.EntryPoint
-val entryPoint = ""
\ No newline at end of file
+val entryPoint = ""
+
+class Owner(@test.anno.EntryPoint val xx: Int) {
+ @test.anno.EntryPoint val yy = 42
+}
\ No newline at end of file