JDK-7151492 : Encapsulate check logic into Attr.ResultInfo
  • Type: Sub-task
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: unknown
  • Submitted: 2012-03-06
  • Updated: 2012-09-28
  • Resolved: 2012-04-20
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
8 b34Fixed
Related Reports
Relates :  
Description
The check routine in Check.checkType is very specific to assignment/return contexts. As it is, that routine cannot be re-used in different contexts (most notably, method check contexts).

This is problematic when moving the code forward - in the case of lambda expressions, a lambda can be type-checked in the middle of overload resolution. We need a slick way to define the type-checking routine in a transparent way w.r.t. check context.

Comments
SUGGESTED FIX A webrev of this fix is available at the following URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/e28a06a3c5d9
26-03-2012

EVALUATION The recently added ResultInfo class could be used as a means to encapsulate the check logic. Since all attribution code already use the current resultInfo parameter to perform checks, it would be a sensible way to parameterize the Check.checkType routine.
06-03-2012