ICSharpCode.NRefactory.MonoCSharp.Nullable.LiftedNull.Create C# (CSharp) Method

Create() public static method

public static Create ( TypeSpec nullable, Location loc ) : Constant
nullable TypeSpec
loc Location
return Constant
		public static Constant Create (TypeSpec nullable, Location loc)
		{
			return new LiftedNull (nullable, loc);
		}

Usage Example

Example #1
0
        public override void Emit(EmitContext ec)
        {
            Label is_null_label = ec.DefineLabel();
            Label end_label     = ec.DefineLabel();

            unwrap.EmitCheck(ec);
            ec.Emit(OpCodes.Brfalse, is_null_label);

            if (user_operator != null)
            {
                user_operator.Emit(ec);
            }
            else
            {
                EmitOperator(ec, NullableInfo.GetUnderlyingType(type));
            }

            ec.Emit(OpCodes.Newobj, NullableInfo.GetConstructor(type));
            ec.Emit(OpCodes.Br_S, end_label);

            ec.MarkLabel(is_null_label);
            LiftedNull.Create(type, loc).Emit(ec);

            ec.MarkLabel(end_label);
        }
All Usage Examples Of ICSharpCode.NRefactory.MonoCSharp.Nullable.LiftedNull::Create