diff options
author | Stephan Herrmann | 2013-12-01 12:44:45 +0000 |
---|---|---|
committer | Stephan Herrmann | 2013-12-01 13:14:24 +0000 |
commit | 1832aee5d00f04e89e8ecf939e65051ef1f988cd (patch) | |
tree | a9a4a937fbc2602fbabc62c110018dd4980c47a6 | |
parent | b782c3ef6e216cdcd365dba6077a7cf049bcd30e (diff) | |
download | eclipse.jdt.core-1832aee5d00f04e89e8ecf939e65051ef1f988cd.tar.gz eclipse.jdt.core-1832aee5d00f04e89e8ecf939e65051ef1f988cd.tar.xz eclipse.jdt.core-1832aee5d00f04e89e8ecf939e65051ef1f988cd.zip |
Experimental fix for GTT.test1060()
- extend isTypeArgumentContainedBy for intersection types in one case
2 files changed, 10 insertions, 2 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java index cf2ee3c109..4362497fcd 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java @@ -34383,7 +34383,7 @@ public void test1030() { ""); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=156765 -// FAIL EXTRA ERR? +// FAIL EXTRA ERR: outer non-generic invocation cannot yet feed expected type into inner inference public void test1031() { this.runNegativeTest( new String[] { @@ -35722,7 +35722,7 @@ public void test1059() { "Type mismatch: cannot convert from capture#1-of ? to Number\n" + "----------\n"); } -// FAIL EXTRA ERR? +// See corresponding FIXME in TypeBinding.isTypeArgumentContainedBy(..) public void test1060() { runConformTest( // test directory preparation diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java index 38b1f9922b..b74dd4212c 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java @@ -1137,6 +1137,14 @@ public boolean isTypeArgumentContainedBy(TypeBinding otherType) { return true; // ? super T <= ? super ? super T if (lowerBound == null) return false; + // FIXME experimental (see GenericTypeTest.test1060()) + if (otherBound instanceof IntersectionCastTypeBinding) { + TypeBinding[] intersecting = ((IntersectionCastTypeBinding)otherBound).intersectingTypes; + for (int i = 0; i < intersecting.length; i++) + if (this.isTypeArgumentContainedBy(intersecting[i])) + return true; + } + // . match = otherBound.findSuperTypeOriginatingFrom(lowerBound); if (match != null && (match = match.leafComponentType()).isRawType()) { return TypeBinding.equalsEquals(match, lowerBound.leafComponentType()); // forbide: Collection <= ? super Collection<?> |