-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b14
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8045161 | 8u25 | Dan Smith | P3 | Resolved | Fixed | b01 |
JDK-8042791 | 8u20 | Dan Smith | P3 | Resolved | Fixed | b15 |
JDK-8052600 | emb-8u26 | Dan Smith | P3 | Resolved | Fixed | b17 |
The following (adapted from Netbeans code in ResultSetJXTable) should compile, but does not after JDK-8033718. The inferred type is correct -- an intersection CAP#1 & Cloneable -- but the error produced afterwards is wrong.
interface RowFilter<X> {}
<R extends Cloneable> void setRowFilter1(RowFilter<? super R> filter) {
setRowFilter2(filter); // expected: ok; actual: error
}
<T extends Cloneable> void setRowFilter2(RowFilter<? super T> filter) { }
}
---
error: method setRowFilter2 in class RowFilterError cannot be applied to given types;
setRowFilter2(filter);
^
required: RowFilter<? super T>
found: RowFilter<CAP#1>
reason: inferred type does not conform to upper bound(s)
inferred: INT#1
upper bound(s): CAP#1,Cloneable
where T,R are type-variables:
T extends Cloneable declared in method <T>setRowFilter2(RowFilter<? super T>)
R extends Cloneable declared in method <R>setRowFilter1(RowFilter<? super R>)
where CAP#1 is a fresh type-variable:
CAP#1 extends Object super: R from capture of ? super R
where INT#1 is an intersection type:
INT#1 extends CAP#1,Cloneable
interface RowFilter<X> {}
<R extends Cloneable> void setRowFilter1(RowFilter<? super R> filter) {
setRowFilter2(filter); // expected: ok; actual: error
}
<T extends Cloneable> void setRowFilter2(RowFilter<? super T> filter) { }
}
---
error: method setRowFilter2 in class RowFilterError cannot be applied to given types;
setRowFilter2(filter);
^
required: RowFilter<? super T>
found: RowFilter<CAP#1>
reason: inferred type does not conform to upper bound(s)
inferred: INT#1
upper bound(s): CAP#1,Cloneable
where T,R are type-variables:
T extends Cloneable declared in method <T>setRowFilter2(RowFilter<? super T>)
R extends Cloneable declared in method <R>setRowFilter1(RowFilter<? super R>)
where CAP#1 is a fresh type-variable:
CAP#1 extends Object super: R from capture of ? super R
where INT#1 is an intersection type:
INT#1 extends CAP#1,Cloneable
- backported by
-
JDK-8042791 Inference produces spurious error for intersection type bounds check
-
- Resolved
-
-
JDK-8045161 Inference produces spurious error for intersection type bounds check
-
- Resolved
-
-
JDK-8052600 Inference produces spurious error for intersection type bounds check
-
- Resolved
-
- relates to
-
JDK-8033718 Inference ignores capture variable as upper bound
-
- Closed
-