lambda: use wildcard bound for inferred param

This commit is contained in:
anna
2012-07-20 18:59:19 +02:00
parent c3276bd56e
commit 01aefae9db
2 changed files with 22 additions and 1 deletions
@@ -123,7 +123,14 @@ public class LambdaUtil {
if (methodSignature != null) {
final PsiType[] types = methodSignature.getParameterTypes();
if (parameterIndex < types.length) {
return resolveResult.getSubstitutor().substitute(types[parameterIndex]);
final PsiType psiType = resolveResult.getSubstitutor().substitute(types[parameterIndex]);
if (psiType instanceof PsiWildcardType) {
final PsiType bound = ((PsiWildcardType)psiType).getBound();
if (bound != null) {
return bound;
}
}
return psiType;
}
}
}