mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
wildcard bounds composition (IDEA-113297)
This commit is contained in:
@@ -176,12 +176,18 @@ public class PsiSubstitutorImpl implements PsiSubstitutor {
|
||||
}
|
||||
|
||||
private static PsiType handleBoundComposition(PsiWildcardType wildcardType, PsiWildcardType bound) {
|
||||
final PsiType newBoundBound = bound.getBound();
|
||||
if (bound.isExtends() == wildcardType.isExtends()) {
|
||||
final PsiType newBoundBound = bound.getBound();
|
||||
if (newBoundBound != null) {
|
||||
return rebound(wildcardType, newBoundBound);
|
||||
}
|
||||
}
|
||||
|
||||
if (newBoundBound != null) {
|
||||
return wildcardType.isExtends() ? PsiWildcardType.createExtends(wildcardType.getManager(), newBoundBound)
|
||||
: PsiWildcardType.createSuper(wildcardType.getManager(), newBoundBound);
|
||||
}
|
||||
|
||||
return PsiWildcardType.createUnbounded(wildcardType.getManager());
|
||||
}
|
||||
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
public class Test {
|
||||
|
||||
{
|
||||
addListener(this::editPropertyChanged);
|
||||
}
|
||||
|
||||
void addListener(ChangeListener<? super Boolean> changeListener){}
|
||||
|
||||
public void editPropertyChanged(Value<? extends Boolean> property) {}
|
||||
|
||||
|
||||
interface ChangeListener <T> {
|
||||
void changed(Value<? extends T> value);
|
||||
}
|
||||
|
||||
class Value<K> {}
|
||||
|
||||
}
|
||||
+4
@@ -145,6 +145,10 @@ public class NewMethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA113297() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user