|
Quick Lists
|
|
Bug ID:
|
6569789
|
|
Votes
|
0
|
|
Synopsis
|
Compiler test lang/TYPE/type153/type15304/type15304.html fails since jdk7 b05
|
|
Category
|
java:compiler
|
|
Reported Against
|
b05
|
|
Release Fixed
|
7(b26),
6-open(b04) (Bug ID:2155641)
|
|
State
|
11-Closed,
Verified,
bug
|
|
Priority:
|
2-High
|
|
Related Bugs
|
2152442
,
6192945
|
|
Submit Date
|
14-JUN-2007
|
|
Description
|
JCK : JCK-COMPILER 6a b14
J2SE : FAIL - fail JDK 7 b05+, PASS b04, PASS jdk 6u2
Platform[s] : FAIL - all
switch/Mode : FAIL - default
The test lang/TYPE/type153/type15304/type15304.html fails since JDK 7 b05 with the message:
type parameters of <W>void cannot be determined; no unique maximal instance exists for type variable W with upper bounds javasoft.sqe.tests.lang.type153.type15304.C,javasoft.sqe.tests.lang.type153.type15304.I,javasoft.sqe.tests.lang.type153.type15304.I1,javasoft.sqe.tests.lang.type153.type15304.I2
testMethod(ct);
^
1 error
This problem was probably introduced by integrating CR 6192945
Posted Date : 2007-06-18 10:06:14.0
|
|
Work Around
|
N/A
|
|
Evaluation
|
This bug is due to the way in which javac calculates glb. When javac computes glb(T1, T2 ... Tn), basically the compiler looks for a type Tk, 1<k<n, such that Tk is a subtype of each Ti, 1<i<n.
In the example however, we have that W = glb(C, I, I1, I2), so javac looks for a type which is a subtype of both C, I, I1 and I2. Unfortunately among the upper bounds of W there is not such common subtype (the situation will be different with C implementing both I, I1 and I2). So the inference fails and the compiler reports the problem.
The JLS state that (5.1.10) "... where the glb(V1, V2 ... ,Vm) is the (intersection) type V1 & V2 ... & Vm. So in this case javac should infer the intersection type C&I&I1&I2 for W. As a general rule, such an intersection type should be created whenever is not possible to find a suitable common subtype among the arguments of glb.
Posted Date : 2007-12-21 14:47:31.0
|
|
Comments
|
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|
|
|
 |