- public class LiftedConversion : Lifted
- {
- public readonly bool IsUser;
- public readonly bool IsExplicit;
- public readonly Type TargetType;
-
- public LiftedConversion (Expression expr, Type target_type, bool is_user,
- bool is_explicit, Location loc)
- : base (expr, loc)
- {
- this.IsUser = is_user;
- this.IsExplicit = is_explicit;
- this.TargetType = target_type;
- }
-
- protected override Expression ResolveUnderlying (Expression unwrap, EmitContext ec)
- {
- Type type = TypeManager.GetTypeArguments (TargetType) [0];
-
- if (IsUser) {
- if (IsExplicit)
- return Convert.ExplicitUserConversion (ec, unwrap, type, loc);
- else
- return Convert.ImplicitUserConversion (ec, unwrap, type, loc);
- } else {
- if (IsExplicit)
- return Convert.ExplicitConversion (ec, unwrap, type, loc);
- else
- return Convert.ImplicitConversion (ec, unwrap, type, loc);
- }
- }
- }
-