Closed
Description
Compiler version
3.3.3, 3.4.0, and the latest nightly 3.4.2-RC1-bin-20240320-0ea0eba-NIGHTLY
Minimized code
//> using scala 3.4.1
//> using options -Wunused:privates
trait Foo {
type X[a]
}
trait Bar[X[_]] {
private final type SelfX[a] = X[a]
val foo: Foo { type X[a] = SelfX[a] }
}
Output
-- Error: /Users/matt/scala-unused-private-type/src/main/scala/example/Test.scala:6:21
6 | private final type SelfX[a] = X[a]
| ^^^^^
| unused private member
Expectation
SelfX
should not be reported as unused. Interestingly, the warning goes away if X
does not have type parameters.