-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #4674: Do not emit waring if types are the same #4684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Well, I would say the warning is legitimate |
Maybe I should improve the warning message instead. |
val msg = s"The highlighted type test will always succeed since the scrutinee type ($foundCls) is a subtype of ${testCls}" | ||
val msg = | ||
if (foundCls != testCls) s"The highlighted type test will always succeed since the scrutinee type ($foundCls) is a subtype of $testCls" | ||
else s"The highlighted type test has the same type ($foundCls) as the scrutinee" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the message. Did you mean something like
The highlighted type test will always succeed since the scrutinee type ($foundCls) is the same as the tested type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will change it to make it clearer.
val msg = s"The highlighted type test will always succeed since the scrutinee type ($foundCls) is a subtype of ${testCls}" | ||
val msg = | ||
if (foundCls != testCls) s"The highlighted type test will always succeed since the scrutinee type ($foundCls) is a subtype of $testCls" | ||
else s"The highlighted type test will always succeed since the scrutinee type ($foundCls) is the same as the tested type" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick:
val msg = {
val addendum =
if (foundCls != testCls) s" is a subtype of $testCls"
else " is the same as the tested type"
s"The highlighted type test will always succeed since the scrutinee type ($foundCls)" + addendum
}
No description provided.