Skip to content

False warning about unused import for local/relative import with Scala 3.3 #18366

@cchantep

Description

@cchantep

Compiler version

3.3.0 & 3.3.1-RC4

Minimized code

  @SuppressWarnings(Array("UnusedMethodParameter"))
  private[api] def serializeWith[P <: SerializationPack](
      pack: P,
      collation: Collation
    )(builder: SerializationPack.Builder[pack.type]
    ): pack.Document = {

    import builder.{ elementProducer => element, int, string, boolean }

    val elements = Seq.newBuilder[pack.ElementProducer]

    elements += element("locale", string(collation.locale))
    ??? // ...
}

See: https://github.com/ReactiveMongo/ReactiveMongo/blob/master/driver/src/main/scala/api/Collation.scala#L166

Output

[error] 166 |    import builder.{ elementProducer => element, int, string, boolean }
[error]     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
[error]     |                     unused import

Expectation

No warning

Metadata

Metadata

Assignees

Labels

area:lintingLinting warnings enabled with -W or -Xlintitype:bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions