bug icon indicating copy to clipboard operation
bug copied to clipboard

Cannot annotate constructor with @varargs

Open scabug opened this issue 11 years ago • 5 comments

You can have varargs constructors in both Scala and Java, but you can't annotate a varargs constructor in Scala with @varargs - you get an error message "A constructor cannot be annotated with a @varargs annotation".

scabug avatar Mar 09 '14 01:03 scabug

Imported From: https://issues.scala-lang.org/browse/SI-8383?orig=1 Reporter: Eric Pederson (ericacm) Affected Versions: 2.10.3

scabug avatar Mar 09 '14 01:03 scabug

@adriaanm said: I think this simply wasn't implemented. Original issue: #3621 Alex, do you remember perhaps?

scabug avatar Mar 10 '14 21:03 scabug

@axel22 said: Yes, this was not implemented deliberately. There was some problem with duplicating constructor methods, IIRC.

Perhaps it's worth taking another look.

scabug avatar Mar 11 '14 08:03 scabug

Eric Pederson (ericacm) said: That would be great. It would enable some nicer APIs that I currently have to resort to using Java for.

scabug avatar Mar 11 '14 11:03 scabug

@adriaanm said: We'll be glad to support contributions, but otherwise this is not on our 2.12 roadmap (to be published soon).

scabug avatar Mar 19 '14 19:03 scabug