Пример #1
0
		protected override Expr VisitConv (ExprConv e)
		{
			this.Visit (e.ExprToConvert);
			Instruction instConv;
			switch (e.ConvToType) {
			case TypeCode.Int32:
				instConv = this.il.Create (OpCodes.Conv_I4);
				break;
			case TypeCode.Int64:
				instConv = this.il.Create (OpCodes.Conv_I8);
				break;
			default:
				throw new NotSupportedException ("Cannot conv to: " + e.ConvToType);
			}
			this.Emit (e, instConv);
			return e;
		}
Пример #2
0
		protected virtual Expr VisitConv (ExprConv e)
		{
			return this.VisitCollection (e, exprs => new ExprConv (e.MethodInfo, exprs.First (), e.ConvToType), e.ExprToConvert);
		}