mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
method signature: don't substitute twice during erasure (IDEA-167386)
This commit is contained in:
@@ -88,7 +88,7 @@ public class MethodSignatureUtil {
|
||||
PsiSubstitutor substitutor = signature.getSubstitutor();
|
||||
PsiType[] erasedTypes = PsiType.createArray(parameterTypes.length);
|
||||
for (int i = 0; i < parameterTypes.length; i++) {
|
||||
erasedTypes[i] = TypeConversionUtil.erasure(substitutor.substitute(parameterTypes[i]), substitutor);
|
||||
erasedTypes[i] = TypeConversionUtil.erasure(parameterTypes[i], substitutor);
|
||||
}
|
||||
return erasedTypes;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
class Foo<T> {
|
||||
void run(T param) {}
|
||||
|
||||
void anonymousClass() {
|
||||
new Foo<T[]>() {
|
||||
@Override
|
||||
void run(T[] param) {}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -622,4 +622,8 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testNotErasedReturnValueUnderJdk7() throws Exception {
|
||||
doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_8, false);
|
||||
}
|
||||
|
||||
public void testAvoidDblSubstitutionDuringErasureOfParameterTypesOfMethodSignature() throws Exception {
|
||||
doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_8, false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user