Skip to content

Commit 906fe52

Browse files
author
Roman Janusz
committed
cosmetic
1 parent e114e2c commit 906fe52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

commons-analyzer/src/main/scala/com/avsystem/commons/analyzer/ConstantDeclarations.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ class ConstantDeclarations(g: Global) extends AnalyzerRule(g, "constantDeclarati
2020

2121
val firstChar = name.toString.charAt(0)
2222
if (constantValue && (firstChar.isLower || !getter.isFinal)) {
23-
report(t.pos, "a constant should be declared as a `final val` with an UpperCamelCase name")
23+
report(t.pos, "a literal-valued constant should be declared as a `final val` with an UpperCamelCase name")
2424
}
25-
if (firstChar.isUpper && !getter.isFinal) {
25+
if (!constantValue && firstChar.isUpper && !getter.isFinal) {
2626
report(t.pos, "a constant with UpperCamelCase name should be declared as a `final val`")
2727
}
2828
if (getter.isFinal && constantValue && !(tpt.tpe =:= rhs.tpe)) {

0 commit comments

Comments
 (0)