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 }
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()); }
public override string ToString() => _field.ToString();
static void TestConstrainedMethodCalls_Unsupported() { MyStruct s = new MyStruct(); s.ToString(); }