KT-13719 'var' can be made 'val' highlighting range with annotation before

#KT-13719 Fixed
This commit is contained in:
Valentin Kipyatkov
2016-10-03 15:13:12 +03:00
parent 8d48b0d2a0
commit 597cd04831
3 changed files with 17 additions and 2 deletions
@@ -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,