Skip to content

Commit

Permalink
Clarify PropertyUsedBeforeDeclaration message (#6126)
Browse files Browse the repository at this point in the history
  • Loading branch information
TWiStErRob committed May 26, 2023
1 parent f51c5a3 commit 6f166ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -76,7 +76,7 @@ class PropertyUsedBeforeDeclaration(config: Config = Config.empty) : Rule(config
member.forEachDescendantOfType<KtNameReferenceExpression> {
val property = allProperties[it.text]
if (property != null && property !in declaredProperties && property == it.descriptor()) {
report(CodeSmell(issue, Entity.from(it), "'${it.text}' is before declaration."))
report(CodeSmell(issue, Entity.from(it), "'${it.text}' is used before declaration."))
}
}
if (member is KtProperty) {
Expand Down
Expand Up @@ -25,7 +25,7 @@ class PropertyUsedBeforeDeclarationSpec(private val env: KotlinCoreEnvironment)
val findings = subject.compileAndLintWithContext(env, code)
assertThat(findings).hasSize(1)
assertThat(findings).hasTextLocations(45 to 52)
assertThat(findings.first()).hasMessage("'isValid' is before declaration.")
assertThat(findings.first()).hasMessage("'isValid' is used before declaration.")
}

@Test
Expand Down

0 comments on commit 6f166ec

Please sign in to comment.