Skip to content

Meta annotation targeting primary constructor #5647

Open
@scabug

Description

@scabug

Annotating a primary constructor is pretty ugly. For example:

@Component
class Foo @Autowired()(val bar: Bar) {
  //...
}

It would be nice if you could target what would normally be a class annotation at the primary constructor - for example:

object Annotations {
  type AutowiredConstructor = Autowired @primaryConstructor
}

@Component
@AutowiredConstructor
class Foo(val bar: Bar) {
  //...
}

Activity

scabug

scabug commented on Apr 6, 2012

@scabug
Author

Imported From: https://issues.scala-lang.org/browse/SI-5647?orig=1
Reporter: Eric Pederson (ericacm)
See #4242

scabug

scabug commented on May 12, 2012

@scabug
Author

@soc said:
Action on one ticket will probably have effect on the other one: #4242 / #5647.

scabug

scabug commented on Sep 17, 2014

@scabug
Author

@retronym said:
Recently requested by the Play team for the same reason.

added this to the Backlog milestone on Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @retronym@scabug

      Issue actions

        Meta annotation targeting primary constructor · Issue #5647 · scala/bug