JDK-8016205 : Lambda Spec: Make varargs access checking a post-compatibility test
  • Type: Bug
  • Component: specification
  • Sub-Component: language
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-06-07
  • Updated: 2014-06-10
  • Resolved: 2013-09-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Fixed
Related Reports
Relates :  
Relates :  
Description
A varargs method is applicable only if the element type is accessible at the call site.  If the element type is an inference variable (alpha[]), inference is left to figure out which choice for alpha will be accessible.  So, in order to support inference, the access check should happen after inference is done.
Comments
Fixed. Updated spec text (Part F, 15.12.3): -- If the compile-time declaration is applicable by variable-arity invocation, then where the last formal parameter type of the invocation type of the method is Fn[], it is a compile-time error if the type which is the erasure of Fn is not accessible at the point of invocation. -- (And the similar check has been removed from 15.12.2.4.)
05-09-2013