'isFunctionLiteralWithoutDeclaredParameterTypes' added

such literals are analyzed at the end of inference without initial influence on the constraint system
This commit is contained in:
Svetlana Isakova
2012-07-03 12:46:25 +04:00
parent f270f9e90a
commit e89a09f470
@@ -339,4 +339,15 @@ public class JetPsiUtil {
ASTNode callOperationNode = call.getCallOperationNode();
return callOperationNode != null && callOperationNode.getElementType() == JetTokens.SAFE_ACCESS;
}
public static boolean isFunctionLiteralWithoutDeclaredParameterTypes(JetExpression expression) {
if (!(expression instanceof JetFunctionLiteralExpression)) return false;
JetFunctionLiteralExpression functionLiteral = (JetFunctionLiteralExpression) expression;
for (JetParameter parameter : functionLiteral.getValueParameters()) {
if (parameter.getTypeReference() != null) {
return false;
}
}
return true;
}
}