internal override Expression VisitMethodCall(MethodCallExpression m) { if (IsMethodCallAllowedEntitySequence(m)) { CheckChainedSequence(m, type); return(base.VisitMethodCall(m)); } if ((m.Object != null && CommonUtil.IsClientType(m.Object.Type)) || m.Arguments.Any((Expression a) => CommonUtil.IsClientType(a.Type))) { throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, "Constructing or initializing instances of the type {0} with the expression {1} is not supported.", type, m.ToString())); } return(base.VisitMethodCall(m)); }
internal override Expression VisitInvocation(InvocationExpression iv) { if (CommonUtil.IsClientType(iv.Expression.Type) || iv.Arguments.Any((Expression a) => CommonUtil.IsClientType(a.Type))) { throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, "Constructing or initializing instances of the type {0} with the expression {1} is not supported.", type, iv.ToString())); } return(base.VisitInvocation(iv)); }
internal override Expression VisitConditional(ConditionalExpression c) { ResourceBinder.PatternRules.MatchNullCheckResult matchNullCheckResult = ResourceBinder.PatternRules.MatchNullCheck(box.ParamExpressionInScope, c); if (matchNullCheckResult.Match) { Visit(matchNullCheckResult.AssignExpression); return(c); } if (CommonUtil.IsClientType(c.Test.Type) || CommonUtil.IsClientType(c.IfTrue.Type) || CommonUtil.IsClientType(c.IfFalse.Type)) { throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, "Constructing or initializing instances of the type {0} with the expression {1} is not supported.", type, c.ToString())); } return(base.VisitConditional(c)); }