Exemplo n.º 1
0
        public static void TestNullableLocal()
        {
            int?n_int      = 5;
            int?n_int_null = null;

            DateTime?n_dt      = new DateTime(2310, 1, 2, 3, 4, 5);
            DateTime?n_dt_null = null;

            ValueTypesTest.GenericStruct <int>?n_gs = new ValueTypesTest.GenericStruct <int> {
                StringField = "n_gs#StringField"
            };
            ValueTypesTest.GenericStruct <int>?n_gs_null = null;

            Console.WriteLine($"break here");
        }
Exemplo n.º 2
0
        public static async Task TestNullableLocalAsync()
        {
            int?n_int      = 5;
            int?n_int_null = null;

            DateTime?n_dt      = new DateTime(2310, 1, 2, 3, 4, 5);
            DateTime?n_dt_null = null;

            ValueTypesTest.GenericStruct <int>?n_gs = new ValueTypesTest.GenericStruct <int> {
                StringField = "n_gs#StringField"
            };
            ValueTypesTest.GenericStruct <int>?n_gs_null = null;

            Console.WriteLine($"break here");
            await Task.CompletedTask;
        }
Exemplo n.º 3
0
    public static void BoxingTest()
    {
        int?   n_i   = 5;
        object o_i   = n_i.Value;
        object o_n_i = n_i;

        object o_s   = "foobar";
        object o_obj = new Math();

        DebuggerTests.ValueTypesTest.GenericStruct <int>?n_gs = new DebuggerTests.ValueTypesTest.GenericStruct <int> {
            StringField = "n_gs#StringField"
        };
        object o_gs   = n_gs.Value;
        object o_n_gs = n_gs;

        DateTime?n_dt   = new DateTime(2310, 1, 2, 3, 4, 5);
        object   o_dt   = n_dt.Value;
        object   o_n_dt = n_dt;
        object   o_null = null;
        object   o_ia   = new int[] { 918, 58971 };

        Console.WriteLine($"break here");
    }
Exemplo n.º 4
0
    public static async System.Threading.Tasks.Task BoxingTestAsync()
    {
        int?   n_i   = 5;
        object o_i   = n_i.Value;
        object o_n_i = n_i;

        object o_s   = "foobar";
        object o_obj = new Math();

        DebuggerTests.ValueTypesTest.GenericStruct <int>?n_gs = new DebuggerTests.ValueTypesTest.GenericStruct <int> {
            StringField = "n_gs#StringField"
        };
        object o_gs   = n_gs.Value;
        object o_n_gs = n_gs;

        DateTime?n_dt   = new DateTime(2310, 1, 2, 3, 4, 5);
        object   o_dt   = n_dt.Value;
        object   o_n_dt = n_dt;
        object   o_null = null;
        object   o_ia   = new int[] { 918, 58971 };

        Console.WriteLine($"break here");
        await System.Threading.Tasks.Task.CompletedTask;
    }