Merge pull request #5675 from mono/glib-debug-symbols
[mono.git] / mcs / tests / gtest-iter-14.cs
1 using System;
2 using System.Collections.Generic;
3
4 class A
5 {
6         protected virtual int BaseM     {
7                 get {
8                         return 2;
9                 }
10                 set
11                 {
12                         throw new ApplicationException ("it should not be called");
13                 }
14         }
15 }
16
17 class B : A
18 {
19         protected override int BaseM {
20                 set
21                 {
22                 }
23         }
24 }
25
26 struct S
27 {
28         public IEnumerable<int> GetIt ()
29         {
30                 yield return base.GetHashCode ();
31         }
32 }
33
34 class X : B
35 {
36         protected override int BaseM {
37                 set
38                 {
39                         throw new ApplicationException ("it should not be called");
40                 }
41         }
42
43         IEnumerable<int> GetIt ()
44         {
45                 yield return base.BaseM++;
46         }
47
48         public static int Main ()
49         {
50                 foreach (var v in new X ().GetIt ())
51                         Console.WriteLine (v);
52
53                 foreach (var v in new S ().GetIt ())
54                         Console.WriteLine (v);
55
56                 return 0;
57         }
58 }