Fix DateTime.Now and CurrentTimeToUtc during DST transition time (#4172)
[mono-project.git] / mcs / tests / gtest-538.cs
blob5458c4b215f901b7aa993fe0b110357d8a7c743d
1 using System;
2 using System.Collections;
3 using System.Collections.Generic;
5 public struct S : IEnumerable<int>
7 public S (int i)
11 public IEnumerator<int> GetEnumerator ()
13 return new Enumerator<int> ();
16 IEnumerator IEnumerable.GetEnumerator ()
18 throw new ApplicationException ();
22 public struct S2
24 public IEnumerator<int> GetEnumerator ()
26 return new Enumerator<int> ();
30 public struct Enumerator<T> : IEnumerator<T>
32 public T Current {
33 get {
34 throw new NotImplementedException ();
38 object IEnumerator.Current {
39 get {
40 throw new NotImplementedException ();
44 public bool MoveNext ()
46 return false;
49 public void Reset ()
51 throw new NotImplementedException ();
54 public void Dispose ()
56 MySystem.DisposeCounter++;
60 public class MySystem
62 public static int DisposeCounter;
64 public static int Main ()
66 S? s = new S ();
67 foreach (var a in s) {
70 if (DisposeCounter != 1)
71 return 1;
73 S2? s2 = new S2 ();
74 foreach (var a in s2) {
77 if (DisposeCounter != 2)
78 return 2;
80 return 0;