[mcs] Flow analysis on reduced expressions need to run on original expression
[mono.git] / mcs / tests / test-pattern-08.cs
1 using System.Collections.Generic;
2
3 class Expr
4 {
5         public int Field;
6         public Expr Next;
7 }
8
9 static class X
10 {
11         public static IEnumerable<int> Test (this Expr expr)
12         {
13                 var exprCur = expr;
14                 while (exprCur != null)
15                 {
16                         if (exprCur is Expr list)
17                         {
18                                 yield return list.Field;
19                                 exprCur = list.Next;
20                         }
21                         else
22                         {
23                                 yield return 2;
24                                 yield break;
25                         }
26                 }
27         }
28
29         public static void Main ()
30         {
31         }
32 }