static void Main()
    {
        var myStruct = new MyStruct();

        Console.WriteLine(myStruct.i);          // prints 0
        Console.WriteLine(myStruct.ToString()); // modifies myStruct, not a copy of myStruct
        Console.WriteLine(myStruct.i);          // prints 1
    }
Esempio n. 2
0
        public void Run()
        {
            MyStruct s = new MyStruct();
            TestApi.WriteLine(s.GetType().ToString());
            TestApi.WriteLine(s.ToString());

            MyEnum e = MyEnum.Default;
            //TestApi.WriteLine(e.CompareTo(e).ToString());
            TestApi.WriteLine(e.GetTypeCode().ToString());
            TestApi.WriteLine(e.ToString());
        }
Esempio n. 3
0
 public override string ToString() => _field.ToString();
Esempio n. 4
0
    static void TestConstrainedMethodCalls_Unsupported()
    {
        MyStruct s = new MyStruct();

        s.ToString();
    }
Esempio n. 5
0
 static void TestConstrainedMethodCalls_Unsupported()
 {
     MyStruct s = new MyStruct();
     s.ToString();
 }