mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
do not infer from parent when inference from bound result in a raw type (IDEA-107782)
This commit is contained in:
@@ -398,6 +398,9 @@ public class PsiResolveHelperImpl implements PsiResolveHelper {
|
||||
final ConstraintType currentConstraintType = currentConstraint.getSecond();
|
||||
if (currentConstraintType == ConstraintType.EQUALS) {
|
||||
substitutionFromBounds = currentSubstitution;
|
||||
if (currentSubstitution == null) {
|
||||
constraints[i] = FAILED_INFERENCE;
|
||||
}
|
||||
break OtherParameters;
|
||||
}
|
||||
else if (currentConstraintType == ConstraintType.SUPERTYPE) {
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
public class Test {
|
||||
{
|
||||
final <error descr="Incompatible types. Found: 'java.lang.Object', required: 'MyResult'">MyResult hello = parseXML(new Parser());</error>
|
||||
}
|
||||
public <R, P extends AbstractParser & Result<R>> R parseXML(P parser) {
|
||||
R result = null;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
class MyResult {}
|
||||
|
||||
class AbstractParser {}
|
||||
interface Result<T> {}
|
||||
class Parser extends AbstractParser implements Result {}
|
||||
|
||||
@@ -238,6 +238,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testIDEA57259() throws Exception { doTest5(false);}
|
||||
public void testIDEA107957() throws Exception { doTest6(false);}
|
||||
public void testIDEA106964() throws Exception { doTest5(false);}
|
||||
public void testIDEA107782() throws Exception { doTest5(false);}
|
||||
public void testInheritedWithDifferentArgsInTypeParams() throws Exception { doTest5(false);}
|
||||
public void testIllegalForwardReferenceInTypeParameterDefinition() throws Exception { doTest5(false);}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user