+ //
+ // Convert input type when it's different to best operator argument
+ //
+ if (s_x != source.Type)
+ source = implicitOnly ?
+ ImplicitConversionStandard (ec, source, s_x, loc) :
+ ExplicitConversionStandard (ec, source, s_x, loc);
+
+ source = new UserCast (most_specific_operator, source, loc).Resolve (ec);
+
+ //
+ // Convert result type when it's different to best operator return type
+ //
+ if (t_x != target_type) {
+ //
+ // User operator is of T?, no need to lift it
+ //
+ if (TypeManager.IsNullableType (t_x) && t_x == target)
+ return source;
+
+ source = implicitOnly ?
+ ImplicitConversionStandard (ec, source, target_type, loc) :
+ ExplicitConversionStandard (ec, source, target_type, loc);
+ }
+
+ //
+ // Source expression is of nullable type, lift the result in case of it's null
+ //
+ if (unwrap != null && (TypeManager.IsReferenceType (target) || target_type != target))
+ source = new Nullable.Lifted (source, unwrap, target).Resolve (ec);
+ else if (target_type != target)
+ source = Nullable.Wrap.Create (source, target);