Skip to content

Meta annotation targeting primary constructor #5647

@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) {
  //...
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions