Skip to content

Warn when @Id / @javax.inject.Named annotation is found on the parameter name not the parameter type #2294

@neko-kai

Description

@neko-kai

Support for reading annotations from the parameter itself is flimsy on Scala 2 and just terrible on Scala 3. We should spit out a warning whenever an @Id annotation is found on the parameter instead of the type.

Bad practice:

class X(
  @Id("x") param: Int
)

Good practice:

class X(
  param: Int @Id("x")
)

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions