mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inference: unchecked warning in type params bounds (IDEA-152758)
This commit is contained in:
+3
@@ -296,6 +296,9 @@ public class InferenceIncorporationPhase {
|
||||
if (eqBound == null || PsiType.NULL.equals(eqBound) || eqBound instanceof PsiWildcardType) continue;
|
||||
if (Registry.is("javac.unchecked.subtyping.during.incorporation", true)) {
|
||||
if (TypeCompatibilityConstraint.isUncheckedConversion(upperBound, eqBound)) {
|
||||
if (PsiUtil.resolveClassInType(eqBound) instanceof PsiTypeParameter) {
|
||||
mySession.setErased();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
abstract class Group {
|
||||
|
||||
public Group() {
|
||||
}
|
||||
|
||||
public <T extends Category> T get(Key<T> key) {
|
||||
<error descr="Incompatible types. Found: 'Category', required: 'T'">return getCategory(key);</error>
|
||||
}
|
||||
|
||||
public abstract <R extends Category<R>> R getCategory(Key<R> key);
|
||||
}
|
||||
|
||||
interface Category<Tc extends Category> {
|
||||
}
|
||||
|
||||
class Key<Tk extends Category> {
|
||||
}
|
||||
+4
@@ -982,4 +982,8 @@ public class GenericsHighlighting8Test extends LightDaemonAnalyzerTestCase {
|
||||
public void testLooseInvocationContextForProperPrimitiveTypes() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testUncheckedWarningsInsideIncorporationPhase() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user