We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8c3f3b9 + 93a5ccc commit 3f69a4eCopy full SHA for 3f69a4e
compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala
@@ -2097,7 +2097,12 @@ object messages {
2097
2098
case class TypeTestAlwaysSucceeds(foundCls: Symbol, testCls: Symbol)(implicit ctx: Context) extends Message(TypeTestAlwaysSucceedsID) {
2099
val kind = "Syntax"
2100
- val msg = s"The highlighted type test will always succeed since the scrutinee type ($foundCls) is a subtype of ${testCls}"
+ val msg = {
2101
+ val addendum =
2102
+ if (foundCls != testCls) s" is a subtype of $testCls"
2103
+ else " is the same as the tested type"
2104
+ s"The highlighted type test will always succeed since the scrutinee type ($foundCls)" + addendum
2105
+ }
2106
val explanation = ""
2107
}
2108
0 commit comments