[interp] Reduce computation under calc_section mutex
[mono-project.git] / mcs / tests / test-pattern-08.cs
blob22b76219c0cc72e3c447cad880851bf4f7919d04
1 using System.Collections.Generic;
3 class Expr
5 public int Field;
6 public Expr Next;
9 static class X
11 public static IEnumerable<int> Test (this Expr expr)
13 var exprCur = expr;
14 while (exprCur != null)
16 if (exprCur is Expr list)
18 yield return list.Field;
19 exprCur = list.Next;
21 else
23 yield return 2;
24 yield break;
29 public static void Main ()