public GotoExpression(GotoExpressionKind kind, LabelTarget target, TypeInfo type, Expression value) { Kind = kind; Target = target; Type = type; Value = value; }
internal GotoExpression(GotoExpressionKind kind, LabelTarget target, Expression value, Type type) { Kind = kind; Value = value; Target = target; Type = type; }
internal GotoExpressionSlim(GotoExpressionKind kind, LabelTargetSlim target, ExpressionSlim value, TypeSlim type) { Kind = kind; Value = value; Target = target; Type = type; }
public GotoExpression(GotoExpressionKind kind, LabelTarget target, TypeInfo?type, Expression?value) { Kind = kind; Target = target.CheckNotNull(nameof(target)); Type = type; Value = value; }
internal GotoExpression(GotoExpressionKind kind, LabelTarget target, Expression value, Type type) { _kind = kind; _value = value; _target = target; _type = type; }
public Expression Update(GotoExpressionKind kind, LabelTarget target, Expression value) { if (Target.Equals(target) && ReferenceEquals(Value, value) && Kind == kind) { return this; } return AstExpression.Return(_returnStatement, ParentScope, Visitor); }
internal GotoExpression(GotoExpressionKind kind, LabelTarget target, XzaarExpression value, XzaarType type) { this.kind = kind; this.value = value; this.target = target; this.type = type; }
internal GotoExpression(GotoExpressionKind kind, LabelTarget target, Expression value, System.Type type) { this._kind = kind; this._value = value; this._target = target; this._type = type; }
public SerializableGotoExpression(GotoExpression expression, SerializableExpressionConverter converter) : base(expression) { Kind = expression.Kind; TargetName = expression.Target.Name; TargetType = expression.Target.Type; Value = converter.Convert(expression.Value); }
public Expression Update(GotoExpressionKind kind, LabelTarget target, Expression value) { if (Target.Equals(target) && ReferenceEquals(Value, value) && Kind == kind) { return(this); } return(AstExpression.Return(_returnStatement, ParentScope, Visitor)); }
public static void TypeContainsGenericParameters(GotoExpressionKind kind) { Assert.Throws <ArgumentException>( "type", () => Expression.MakeGoto(kind, Expression.Label(typeof(void)), null, typeof(List <> .Enumerator))); Assert.Throws <ArgumentException>( "type", () => Expression.MakeGoto( kind, Expression.Label(typeof(void)), null, typeof(List <>).MakeGenericType(typeof(List <>)))); }
public static void TypeContainsGenericParameters(GotoExpressionKind kind) { Assert.Throws<ArgumentException>( "type", () => Expression.MakeGoto(kind, Expression.Label(typeof(void)), null, typeof(List<>.Enumerator))); Assert.Throws<ArgumentException>( "type", () => Expression.MakeGoto( kind, Expression.Label(typeof(void)), null, typeof(List<>).MakeGenericType(typeof(List<>)))); }
public static GotoExpression MakeGoto(GotoExpressionKind kind, LabelTarget?target, Expression?value, Type type) { if (target == null) { throw new ArgumentNullException(nameof(target)); } ValidateGoto(target, ref value, nameof(value), type); return(new GotoExpression(kind, target, value, type)); }
public SerializableGotoExpression(GotoExpression expression, SerializableExpressionConverter converter) : base(expression) { Contract.Requires(expression != null); Contract.Requires(converter != null); Kind = expression.Kind; TargetName = expression.Target.Name; TargetType = expression.Target.Type; Value = converter.TryConvert(expression.Value); }
public static void Deconstruct( this GotoExpression expr, out ExpressionType operation, out GotoExpressionKind kind, out LabelTarget target) { kind = expr?.Kind ?? throw new ArgumentNullException(nameof(expr)); operation = expr.NodeType; target = expr.Target; }
public ParsedGotoExpression( GotoExpressionKind kind, ParsedLabelTarget target, ParsedType type, ParsedExpression value) : base() { this.Kind = kind; this.Target = target; this.Type = type; this.Value = value; }
private void Append(GotoExpressionKind kind) => _sb.Append(s_gotoExpressionKindToString[(int)kind]);
public GotoExpression(GotoExpressionKind kind, LabelTarget target, Type?type, Expression?value) : this(kind, target, type.AsTypeInfo(), value) { }
/// <summary> /// Creates a <see cref="GotoExpression"/> representing a jump of the specified <see cref="GotoExpressionKind"/>. /// The value passed to the label upon jumping can also be specified. /// </summary> /// <param name="kind">The <see cref="GotoExpressionKind"/> of the <see cref="GotoExpression"/>.</param> /// <param name="target">The <see cref="LabelTarget"/> that the <see cref="GotoExpression"/> will jump to.</param> /// <param name="value">The value that will be passed to the associated label upon jumping.</param> /// <param name="type">An <see cref="System.Type"/> to set the <see cref="P:Expression.Type"/> property equal to.</param> /// <returns> /// A <see cref="GotoExpression"/> with <see cref="P:GotoExpression.Kind"/> equal to <paramref name="kind"/>, /// the <see cref="P:GotoExpression.Target"/> property set to <paramref name="target"/>, /// the <see cref="P:Expression.Type"/> property set to <paramref name="type"/>, /// and <paramref name="value"/> to be passed to the target label upon jumping. /// </returns> public static GotoExpression MakeGoto(GotoExpressionKind kind, LabelTarget target, Expression value, Type type) { ValidateGoto(target, ref value, "target", "value"); return new GotoExpression(kind, target, value, type); }
public void ByRefType(GotoExpressionKind kind) { Assert.Throws <ArgumentException>( "type", () => Expression.MakeGoto(kind, Expression.Label(typeof(void)), null, typeof(int).MakeByRefType())); }
public void OpenGenericType(GotoExpressionKind kind) { Assert.Throws<ArgumentException>( "type", () => Expression.MakeGoto(kind, Expression.Label(typeof(void)), null, typeof(List<>))); }
public void OpenGenericType(GotoExpressionKind kind) { Assert.Throws <ArgumentException>( "type", () => Expression.MakeGoto(kind, Expression.Label(typeof(void)), null, typeof(List <>))); }
public static GotoExpression MakeGoto(GotoExpressionKind kind, LabelTarget target, Expression value, Type type = null) => new GotoExpression(kind, target, value, type ?? typeof(void));
/// <summary> /// Creates a <see cref="GotoExpression" /> representing a jump of the specified <see cref="GotoExpressionKind" />. /// The value passed to the label upon jumping can also be specified. /// </summary> /// <param name="kind">The <see cref="GotoExpressionKind" /> of the <see cref="GotoExpression" />.</param> /// <param name="target">The <see cref="LabelTarget" /> that the <see cref="GotoExpression" /> will jump to.</param> /// <param name="value">The value that will be passed to the associated label upon jumping.</param> /// <param name="type">A <see cref="System.Type" /> to set the <see cref="Type" /> property equal to.</param> /// <returns> /// A <see cref="GotoExpression" /> with <see cref="GotoExpression.Kind" /> equal to <paramref name="kind" />, /// the <see cref="GotoExpression.Target" /> property set to <paramref name="target" />, /// the <see cref="Type" /> property set to <paramref name="type" />, /// and <paramref name="value" /> to be passed to the target label upon jumping. /// </returns> public static GotoExpression MakeGoto(GotoExpressionKind kind, LabelTarget target, Expression value, Type type) { ValidateGoto(target, ref value, nameof(target), nameof(value), type); return(new GotoExpression(kind, target, value, type)); }
public static GotoExpression MakeGoto(GotoExpressionKind kind, LabelTarget target, XzaarExpression value, XzaarType type) { ValidateGoto(target, ref value, "target", "value"); return(new GotoExpression(kind, target, value, type)); }
internal GotoExpression(GotoExpressionKind kind, LabelTarget target, Expression value) { _kind = kind; _value = value; _target = target; }
public GotoExpression(GotoExpressionKind kind, LabelTarget target, Type type, Expression value) : this(kind, target, ReferenceEquals(null, type) ? null : new TypeInfo(type, false, false), value) { }
public void ByRefType(GotoExpressionKind kind) { Assert.Throws<ArgumentException>( "type", () => Expression.MakeGoto(kind, Expression.Label(typeof(void)), null, typeof(int).MakeByRefType())); }
public GotoExpression(GotoExpressionKind kind, LabelTarget target, Type type, Expression value) : this(kind, target, type is null ? null : new TypeInfo(type, false, false), value) { }
private static int CalcHashCode(GotoExpressionKind kind) { return((int)kind); }