-
Bug
-
Resolution: Fixed
-
P3
-
7u45, 8
-
b13
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8045160 | 8u25 | Dan Smith | P3 | Resolved | Fixed | b01 |
JDK-8042337 | 8u20 | Dan Smith | P3 | Resolved | Fixed | b15 |
JDK-8052599 | emb-8u26 | Dan Smith | P3 | Resolved | Fixed | b17 |
class C<T> {}
<X> void m(C<? super X> arg) {}
void test(C<?> arg) {
m(arg);
}
error: method m in class cannot be applied to given types;
m(arg);
^
required: C<? super X>
found: C<CAP#1>
reason: cannot infer type-variable(s) X
(argument mismatch; C<CAP#1> cannot be converted to C<? super X>)
where X is a type-variable:
X extends Object declared in method <X>m(C<? super X>)
where CAP#1 is a fresh type-variable:
CAP#1 extends Object from capture of ?
1 error
The error is the same under both -source 8 and -source 7.
This is a regression: there is also an error in javac 7, but not javac 6.
- backported by
-
JDK-8042337 Inference ignores capture variable as upper bound
-
- Resolved
-
-
JDK-8045160 Inference ignores capture variable as upper bound
-
- Resolved
-
-
JDK-8052599 Inference ignores capture variable as upper bound
-
- Resolved
-
- duplicates
-
JDK-8144209 Type variable capture fails to imply type of lower bound via loose compatibility
-
- Closed
-
- relates to
-
JDK-8039222 5.1.10: Define glb for non-class types
-
- Open
-
-
JDK-8046762 Revert some inference fixes in JDK-8033718
-
- Resolved
-
-
JDK-8039214 Inference should not map capture variables to their upper bounds
-
- Closed
-
-
JDK-8042656 Inference produces spurious error for intersection type bounds check
-
- Closed
-
-
JDK-8044546 Crash on faulty reduce/lambda
-
- Closed
-
-
JDK-7086586 Inference producing null type argument
-
- Closed
-
-
JDK-8042338 Refactor Types.upperBound to treat wildcards and variables separately
-
- Closed
-
-
JDK-8042803 Types.wildLowerBound and cvarLowerBound should call unannotatedType()
-
- Closed
-
-
JDK-8170885 18.4: Avoid inferring capture variables during resolution
-
- Open
-
-
JDK-8051402 javac, type containment should accept that CAP <= ? extends CAP and CAP <= ? super CAP
-
- Resolved
-
-
JDK-8032268 compilation mismatch between javac 8 source 7 and javac 7 source 7
-
- Closed
-
-
JDK-8043914 Inference failure involving capture inference variable
-
- Closed
-
-
JDK-8067858 Method hiding regression
-
- Closed
-
-
JDK-8133118 Incompatible static wildcard bounds
-
- Closed
-
-
JDK-8133916 Regression in inference for array type with wildcard
-
- Closed
-
-
JDK-8144066 StackOverflowException when computing glb
-
- Closed
-
-
JDK-8155072 Type inference regression
-
- Closed
-
-
JDK-7190296 unsoundness in type-containment implementation
-
- Closed
-
-
JDK-8160114 Unexpected inferred type from wildcard subtyping constraint
-
- Closed
-