- 
        Couldn't load subscription status. 
- Fork 1.1k
Closed
Labels
area:annotationsarea:implicitsrelated to implicitsrelated to implicitsarea:lintingLinting warnings enabled with -W or -XlintLinting warnings enabled with -W or -Xlintitype:bugregressionThis worked in a previous version but doesn't anymoreThis worked in a previous version but doesn't anymore
Milestone
Description
Compiler version
3.7.0-RC3
Minimized code
import scala.util.NotGiven
import scala.annotation.unused
object Test {
  given [T](using @unused ev: NotGiven[T <:< Int]): AnyRef with {}
}Output
Compiled using -Wunused:all
-- [E198] Unused Symbol Warning: unused_notgiven_annotation.scala:5:26 -----------------------
5 |  given [T](using @unused ev: NotGiven[T <:< Int]): AnyRef with {}
  |                          ^^
  |                          unused implicit parameter
1 warning found
Expectation
@unused should silence the warning as it does in other cases.
For example changing the code to
import scala.util.NotGiven
import scala.annotation.unused
object Test {
  given [T](using @unused ev: NotGiven[T <:< Int]): AnyRef = new AnyRef {}
}works as expected.
Metadata
Metadata
Assignees
Labels
area:annotationsarea:implicitsrelated to implicitsrelated to implicitsarea:lintingLinting warnings enabled with -W or -XlintLinting warnings enabled with -W or -Xlintitype:bugregressionThis worked in a previous version but doesn't anymoreThis worked in a previous version but doesn't anymore