Mono.CSharp.TypeManager.IsNullableType C# (CSharp) Method

IsNullableType() public static method

public static IsNullableType ( System.TypeSpec t ) : bool
t System.TypeSpec
return bool
	public static bool IsNullableType (TypeSpec t)
	{
		return generic_nullable_type == t.GetDefinition ();
	}
#endregion

Usage Example

Example #1
0
        public override Constant ConvertExplicitly(bool inCheckedContext, Type targetType)
        {
            if (targetType.IsPointer)
            {
                if (type == TypeManager.null_type || this is NullPointer)
                {
                    return(new EmptyConstantCast(new NullPointer(loc), targetType));
                }

                return(null);
            }

            // Exlude internal compiler types
            if (targetType == InternalType.AnonymousMethod)
            {
                return(null);
            }

            if (type != TypeManager.null_type && !Convert.ImplicitStandardConversionExists(this, targetType))
            {
                return(null);
            }

            if (TypeManager.IsReferenceType(targetType))
            {
                return(new NullLiteral(targetType, loc));
            }

            if (TypeManager.IsNullableType(targetType))
            {
                return(Nullable.LiftedNull.Create(targetType, loc));
            }

            return(null);
        }
All Usage Examples Of Mono.CSharp.TypeManager::IsNullableType