JDK-8030148 : Lambda Spec: Reduction for Foo = Foo
  • Type: Bug
  • Component: specification
  • Sub-Component: language
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-12-14
  • Updated: 2016-08-11
  • Resolved: 2013-12-14
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 :  
Relates :  
Description
An unbound wildcard "?" is equivalent to "? extends Object" (see JDK-6480391).  Thus, an equality constraint can be reduced by treating "?" as if it were "? extends Object".  It should even be possible to reduce "Foo<?> = Foo<? extends alpha>" to "alpha = Object".
Comments
A similar update for 18.2.3, on the basis that '?' and '? extends Object' are equivalent: If T is a type: ... If T is a wildcard ***of the form ?***, the constraint reduces to true. [No need to cover '? extends Object' here.] If T is a wildcard of the form ? extends T': - If S is a type, the constraint reduces to ���S <: T'���. - ***If S is a wildcard of the form ?, the constraint reduces to ���Object <: T'���.*** - If S is a wildcard of the form ? extends S', the constraint reduces to ���S' <: T'���. - ***If S is a wildcard of the form ? super S', the constraint reduces to ���Object = T'���.*** If T is a wildcard of the form ? super T': ...
14-12-2013

New rules for 18.2.4: A constraint formula of the form ���S = T���, where S and T are type arguments (4.5.1), is reduced as follows: - If S and T are types, the constraint is reduced as described above. - If S has the form ? and T has the form ?, the constraint reduces to true. - ***If S has the form ? and T has the form ? extends T', the constraint reduces to ���Object = T'���.*** - ***If S has the form ? extends S' and T has the form ?, the constraint reduces to ���S' = Object���.*** - If S has the form ? extends S' and T has the form ? extends T', the constraint reduces to ���S' = T'���. - If S has the form ? super S' and T has the form ? super T', the constraint reduces to ���S' = T'���. - Otherwise, the constraint reduces to false.
14-12-2013