public static TypeSpec MakeType (ModuleContainer module, TypeSpec underlyingType) { return module.PredefinedTypes.Nullable.TypeSpec.MakeGenericType (module, new[] { underlyingType }); } }
Expression LiftOperand(ResolveContext rc, Expression expr) { TypeSpec type; if (expr.IsNull) { type = Left.IsNull ? Right.Type : Left.Type; } else { type = expr.Type; } if (!type.IsNullableType) { type = NullableInfo.MakeType(rc.Module, type); } return(Wrap.Create(expr, type)); }