Skip to content

Regression in -Wunused in 3.3.7 #24713

@mpilquist

Description

@mpilquist

Compiler version

3.3.7

Minimized code

//> using scala 3.3.7
//> using options -Wunused:all

trait Codec[A]
class DiscrimatorCodec[A](val framing: [x] => Codec[x] => Codec[x])

def foo[A] =
  new DiscrimatorCodec[A]([x] => (cx: Codec[x]) => cx)

Output

❯ scala-cli compile u.scala
Compiling project (Scala 3.3.7, JVM (17))
[warn] ./u.scala:8:28
[warn] unused private member
[warn]   new DiscrimatorCodec[A]([x] => (cx: Codec[x]) => cx)
[warn]                            ^
Compiled project (Scala 3.3.7, JVM (17))

Expectation

There should not be an "unused private member" warning on the final line of this source file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:lintingLinting warnings enabled with -W or -Xlintitype:bugregressionThis worked in a previous version but doesn't anymorestat:fixed in nextThe issue was fixed in Next and only still applies to LTS.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions