Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,12 @@ public ParameterizedTypeBinding capture(Scope scope, int start, int end) {
if (wildcard.boundKind == Wildcard.SUPER && wildcard.bound.id == TypeIds.T_JavaLangObject) {
capturedArguments[i] = wildcard.bound;
} else {
capturedArguments[i] = this.environment.createCapturedWildcard(wildcard, contextType, start, end, cud, compilationUnitScope::nextCaptureID);
freshCaptures[i] = true;
if (wildcard.boundKind == Wildcard.EXTENDS && wildcard.otherBounds == null && wildcard.bound instanceof CaptureBinding) {
capturedArguments[i] = wildcard.bound;
} else {
capturedArguments[i] = this.environment.createCapturedWildcard(wildcard, contextType, start, end, cud, compilationUnitScope::nextCaptureID);
freshCaptures[i] = true;
}
}
} else {
capturedArguments[i] = argument;
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.core.tests.compiler;singleton:=true
Bundle-Version: 3.13.1100.qualifier
Bundle-Version: 3.13.1200.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.jdt.core.tests.compiler,
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.jdt.core.tests.compiler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<relativePath>../tests-pom/</relativePath>
</parent>
<artifactId>org.eclipse.jdt.core.tests.compiler</artifactId>
<version>3.13.1100-SNAPSHOT</version>
<version>3.13.1200-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10964,4 +10964,32 @@ <X, Y extends One<X>> void foo2(Y y1) {
"The method bar(One<Inner<?>>) in the type Bug is not applicable for the arguments (One<Inner<X>>)\n" +
"----------\n");
}
// https://github.com/eclipse-jdt/eclipse.jdt.core/issues/4867
public void testGH4867() {
runConformTest(
new String[] {
"MessageExpressionVoterTests.java",
"""
public class MessageExpressionVoterTests {
MessageMatcher<?> matcher = new MessageMatcher<String>() {
};

public boolean voteGranted() {
return this.matcher.matcher(ArgumentMatchers.any());
}
}
interface MessageMatcher<T> {
default boolean matcher(Message<? extends T> message) {
return true;
}
}
interface Message<T> {}
class ArgumentMatchers {
public static <T> T any() {
return null;
}
}
"""
});
}
}
Loading