return resolveLambda(node);
}
@Override
public ResolveResult visitMemberReferenceExpression(final MemberReferenceExpression node, final Void _) {
final ResolveResult targetResult = node.getTarget().acceptVisitor(this, _);
MemberReference memberReference = node.getUserData(Keys.MEMBER_REFERENCE);
if (memberReference == null) {
if (StringUtilities.equals(node.getMemberName(), "length")) {
if (targetResult != null &&
targetResult.getType() != null &&
targetResult.getType().isArray()) {
return new ResolveResult(BuiltinTypes.Integer);
}
}
if (node.getParent() instanceof InvocationExpression) {
memberReference = node.getParent().getUserData(Keys.MEMBER_REFERENCE);
}
}
else if (targetResult != null &&
targetResult.getType() != null) {
if (memberReference instanceof FieldReference) {
final FieldDefinition resolvedField = ((FieldReference) memberReference).resolve();
memberReference = MetadataHelper.asMemberOf(
resolvedField != null ? resolvedField : (FieldReference) memberReference,
targetResult.getType()
);
}
else {
final MethodDefinition resolvedMethod = ((MethodReference) memberReference).resolve();
memberReference = MetadataHelper.asMemberOf(
resolvedMethod != null ? resolvedMethod : (MethodReference) memberReference,
targetResult.getType()
);
}
}
return resolveTypeFromMember(memberReference);