unchecked warning: keep warning for all generic class types (IDEA-259694)

ignore if target type was raw, found by integration test

GitOrigin-RevId: eee1c2d03c94d25f25a9e709c1f6e776383b3401
This commit is contained in:
Anna Kozlova
2021-01-21 11:35:07 +00:00
committed by intellij-monorepo-bot
parent 619b747f0a
commit 0efd80e15f
2 changed files with 9 additions and 1 deletions
@@ -540,7 +540,7 @@ public final class PsiTypesUtil {
if (type instanceof PsiClassType) {
PsiClass aClass = ((PsiClassType)type).resolveGenerics().getElement();
if (aClass instanceof PsiTypeParameter ||
aClass != null && PsiUtil.typeParametersIterator(aClass).hasNext()) {
aClass != null && PsiUtil.typeParametersIterator(aClass).hasNext() && !((PsiClassType)type).isRaw()) {
return true;
}
}
@@ -24,3 +24,11 @@ class Bar2 {
return null;
}
}
class Bar3<<warning descr="Type parameter 'K' is never used">K</warning>> {
class Foo<<warning descr="Type parameter 'T' is never used">T</warning>> {}
void m(Foo <warning descr="Parameter 'rawFoo' is never used">rawFoo</warning>) {}
void n(Bar3 b, Foo rawFoo) {
b.m(rawFoo);
}
}