diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/CanBeValInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/CanBeValInspection.kt
index 08c082df8bb..0f2097ddc43 100644
--- a/idea/src/org/jetbrains/kotlin/idea/inspections/CanBeValInspection.kt
+++ b/idea/src/org/jetbrains/kotlin/idea/inspections/CanBeValInspection.kt
@@ -127,9 +127,10 @@ class CanBeValInspection : AbstractKotlinInspection() {
}
private fun reportCanBeVal(declaration: KtValVarKeywordOwner) {
+ val keyword = declaration.valOrVarKeyword!!
val problemDescriptor = holder.manager.createProblemDescriptor(
- declaration,
- declaration.valOrVarKeyword!!,
+ keyword,
+ keyword,
"Variable is never modified and can be declared immutable using 'val'",
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
isOnTheFly,
diff --git a/idea/testData/inspections/canBeVal/inspectionData/expected.xml b/idea/testData/inspections/canBeVal/inspectionData/expected.xml
index a7684e464ff..5ab6a2c1487 100644
--- a/idea/testData/inspections/canBeVal/inspectionData/expected.xml
+++ b/idea/testData/inspections/canBeVal/inspectionData/expected.xml
@@ -70,4 +70,13 @@
Local 'var' is never modified and can be declared as 'val'
Variable is never modified and can be declared immutable using 'val'
+
+
+ withAnnotation.kt
+ 3
+ light_idea_test_case
+
+ Local 'var' is never modified and can be declared as 'val'
+ Variable is never modified and can be declared immutable using 'val'
+
diff --git a/idea/testData/inspections/canBeVal/withAnnotation.kt b/idea/testData/inspections/canBeVal/withAnnotation.kt
new file mode 100644
index 00000000000..1b4184ca485
--- /dev/null
+++ b/idea/testData/inspections/canBeVal/withAnnotation.kt
@@ -0,0 +1,5 @@
+fun foo(p: List) {
+ @Suppress("UNCHECKED_CAST")
+ var v = p as List
+ print(v)
+}
\ No newline at end of file