-
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 -Xlintitype:bug
Milestone
Description
Compiler version
3.7.0-RC1-bin-20250306-73ba485-NIGHTLY
Minimized code
With -Wunused:explicits
enabled:
trait Foldable[F[_]] {
def foldLeft[A, B](fa: F[A], b: B)(f: (B, A) => B): B
}
type Id[A] = A
given foldableId: Foldable[Id] =
new Foldable[Id] {
def foldLeft[A, B](fa: Id[A], b: B)(f: (B, A) => B): B = b
}
Output
-- [E198] Unused Symbol Warning: /Users/matt/scala3.7-nightly-unused/src/main/scala/example/Test.scala:9:23
9 | def foldLeft[A, B](fa: Id[A], b: B)(f: (B, A) => B): B = b
| ^^
| unused explicit parameter
-- [E198] Unused Symbol Warning: /Users/matt/scala3.7-nightly-unused/src/main/scala/example/Test.scala:9:40
9 | def foldLeft[A, B](fa: Id[A], b: B)(f: (B, A) => B): B = b
| ^
| unused explicit parameter
Expectation
The parameters should not be reported unused since they're necessary to satisfy the method override
Metadata
Metadata
Assignees
Labels
area:lintingLinting warnings enabled with -W or -XlintLinting warnings enabled with -W or -Xlintitype:bug