/// <summary> /// Visits a type binary expression slim tree node, produces a type binary expression. /// </summary> /// <param name="node">Node to visit.</param> /// <param name="expression">Expression operand.</param> /// <returns>The type binary expression represented by the expression slim node.</returns> protected override Expression MakeTypeBinary(TypeBinaryExpressionSlim node, Expression expression) { var typeOperand = MakeType(node.TypeOperand); return(node.NodeType switch { ExpressionType.TypeIs => _factory.TypeIs(expression, typeOperand), ExpressionType.TypeEqual => _factory.TypeEqual(expression, typeOperand), _ => throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, "Type expression type '{0}' not supported.", node.NodeType)), });
protected internal override ExpressionSlim VisitTypeBinary(TypeBinaryExpressionSlim node) { Append(node.NodeType); Append('('); Visit(node.Expression); Append(", "); Append(node.TypeOperand); Append(')'); return(node); }
/// <summary> /// Visits a type binary expression tree node. /// </summary> /// <param name="node">Node to visit.</param> /// <returns>Result of visiting the node.</returns> protected internal virtual ExpressionSlim VisitTypeBinary(TypeBinaryExpressionSlim node) { return(node.Update(Visit(node.Expression))); }