public void Emit(CompilationContext context) { context.LoadSource(LoadPurpose.Parameter); context.CurrentType = typeof(TSource); _invokerBuilder.Emit(context); context.CurrentType = typeof(TTarget); }
public void Emit(CompilationContext context) { context.EmitTypeOf(typeof(TTarget)); context.CurrentType = typeof(Type); _invokerBuilder.Emit(context); context.EmitCast(typeof(TTarget)); }
public override void Emit(Type sourceType, Type targetType, CompilationContext context) { if (typeof(TSource) != sourceType) { context.EmitCast(typeof(TSource)); } _invokerBuilder.Emit(context); if (targetType != typeof(TTarget)) { context.EmitCast(targetType); } context.CurrentType = targetType; }
protected override void EmitSource(CompilationContext context) { context.LoadSource(LoadPurpose.Parameter); _invokerBuilder.Emit(context); context.CurrentType = SourceType; }