scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

Meta annotation targeting primary constructor #5647

Open scabug opened 12 years ago

scabug commented 12 years ago

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) {
  //...
}
scabug commented 12 years ago

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

scabug commented 12 years ago

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

scabug commented 10 years ago

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