move smart completion assignability checking closer to reference processor to fix

IDEADEV-40813 Smart completion inside "​if" statement with "​instanceof" in condition doesn​'​t suggest method with generic return type
This commit is contained in:
peter
2009-10-14 23:43:34 +01:00
parent 2d561686f4
commit 41f136134d
15 changed files with 236 additions and 166 deletions
@@ -792,6 +792,11 @@ public class JavaCompletionUtil {
final PsiType qualifierType = getPsiType(element.getObject());
final LookupItem lookupItem = element.as(LookupItem.class);
if (lookupItem != null) {
final Object o = lookupItem.getAttribute(LookupItem.TYPE);
if (o instanceof PsiType) {
return (PsiType)o;
}
final PsiSubstitutor substitutor = (PsiSubstitutor)lookupItem.getAttribute(LookupItem.SUBSTITUTOR);
if (substitutor != null) {
return substitutor.substitute(qualifierType);