mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
new inference: same parametrization check tweaked (IDEA-130519)
This commit is contained in:
+1
-1
@@ -549,7 +549,7 @@ public class InferenceSession {
|
||||
final Processor<Pair<PsiType, PsiType>> differentParameterizationProcessor = new Processor<Pair<PsiType, PsiType>>() {
|
||||
@Override
|
||||
public boolean process(Pair<PsiType, PsiType> pair) {
|
||||
return pair.first == null || pair.second == null || pair.first.equals(pair.second);
|
||||
return pair.first == null || pair.second == null || !TypesDistinctProver.provablyDistinct(pair.first, pair.second);
|
||||
}
|
||||
};
|
||||
if (InferenceIncorporationPhase.findParameterizationOfTheSameGenericClass(bounds, differentParameterizationProcessor)) return true;
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
import java.util.Optional;
|
||||
|
||||
interface Work<T> {
|
||||
T execute();
|
||||
}
|
||||
|
||||
interface Result {}
|
||||
|
||||
class ResultImpl implements Result {}
|
||||
|
||||
class Provider {
|
||||
<T> T doWork(Work<T> work) {
|
||||
return work.execute();
|
||||
}
|
||||
}
|
||||
|
||||
class Main {
|
||||
public static void main(String[] args) {
|
||||
final Provider provider = new Provider();
|
||||
final Optional<Result> result = provider.doWork(() -> {
|
||||
if (args.length > 1) {
|
||||
return Optional.of(new ResultImpl());
|
||||
} else {
|
||||
return Optional.of(new ResultImpl());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
+4
@@ -134,6 +134,10 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSameParametrizationCheckTakesTypeParametersIntoAccount() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
@Bombed(month = Calendar.OCTOBER, day = 30)
|
||||
public void testCheckedExceptionsConstraintsSubstitutions() throws Exception {
|
||||
doTest();
|
||||
|
||||
Reference in New Issue
Block a user