> On 29 Sep 2020, at 22:32, Brian Goetz <brian.go...@oracle.com> wrote: > > Should @SafeVarargs be allowed to be applied to a varargs record? Should it > get propagated to the constructor in that case? Or do we just have people > declare a compact constructor with @SafeVarargs? What is the correct use of > @SV for varargs records?
Right now, if you annotate a record component with @SafeVarArgs you are in trouble, because @SafeVarArgs is applicable in the method context, and so it will be propagated to the accessor method. As the accessor method is a fixed arity method, that’s going to be an error. We say currently that you should declare a constructor with @SafeVarArgs. That seems reasonable to me. Unless someone thinks otherwise, I don’t think we should be special-casing this annotation. (I guess we can always do this in a later release.) Gavin