lambda: tests

This commit is contained in:
anna
2012-07-20 18:59:19 +02:00
parent 01aefae9db
commit 7f8362d025
11 changed files with 271 additions and 2 deletions
@@ -204,7 +204,7 @@ public class LambdaUtil {
return false;
}
if (!resolveResult.getSubstitutor().substitute(methodParameterType).isAssignableFrom(lambdaFormalType)) {
if (!resolveResult.getSubstitutor().substitute(methodSignature.getSubstitutor().substitute(methodParameterType)).isAssignableFrom(lambdaFormalType)) {
return false;
}
}
@@ -221,7 +221,7 @@ public class LambdaUtil {
LOG.assertTrue(method != null);
PsiType methodReturnType = method.getReturnType();
if (methodReturnType != null && methodReturnType != PsiType.VOID) {
methodReturnType = resolveResult.getSubstitutor().substitute(methodReturnType);
methodReturnType = resolveResult.getSubstitutor().substitute(methodSignature.getSubstitutor().substitute(methodReturnType));
final PsiElement body = lambdaExpression.getBody();
if (body instanceof PsiCodeBlock) {
final PsiCodeBlock block = (PsiCodeBlock)body;