ICSharpCode.NRefactory.MonoCSharp.Nullable.NullableInfo.MakeType C# (CSharp) Method

MakeType() public static method

public static MakeType ( ModuleContainer module, TypeSpec underlyingType ) : TypeSpec
module ModuleContainer
underlyingType TypeSpec
return TypeSpec
		public static TypeSpec MakeType (ModuleContainer module, TypeSpec underlyingType)
		{
			return module.PredefinedTypes.Nullable.TypeSpec.MakeGenericType (module,
				new[] { underlyingType });

		}
	}

Usage Example

Example #1
0
        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));
        }