[mcs] Add expression bodied syntax for accessors. Fixes #54991
[mono.git] / mcs / errors / cs1621.cs
1 // CS01621: The yield statement cannot be used inside anonymous method blocks
2 // Line: 13
3
4 using System.Collections;
5
6 delegate object D ();
7
8 class C: IEnumerable
9 {
10    public IEnumerator GetEnumerator ()
11    {
12       D d = delegate {
13                 yield return this;
14           };
15    }
16 }