-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area:lintingLinting warnings enabled with -W or -XlintLinting warnings enabled with -W or -Xlintarea:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesIssues concerned with improving confusing/unhelpful diagnostic messagesitype:enhancement
Milestone
Description
Compiler version
3.7.0-RC1
Minimized example
import scala.util.NotGiven
object Test {
def f[T](a: Int)(using NotGiven[T <:< Int]) = a + 2
}
Output Error/Warning message
-- [E198] Unused Symbol Warning: unused_notgiven.scala:4:25 ----------------------------------
4 | def f[T](a: Int)(using NotGiven[T <:< Int]) = a + 2
| ^
| unused implicit parameter
1 warning found
Why this Error/Warning was not helpful
The unused warning is not useful as NotGiven
is just used for evidence and not expected to be used explicitly.
Suggested improvement
It could be made more helpful if no warning was produced. I belive NotGiven
could be excluded here
case dd.DummyImplicitClass | dd.SubTypeClass | dd.SameTypeClass => true |
<:<
and =:=
.Metadata
Metadata
Assignees
Labels
area:lintingLinting warnings enabled with -W or -XlintLinting warnings enabled with -W or -Xlintarea:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesIssues concerned with improving confusing/unhelpful diagnostic messagesitype:enhancement