[LoongArch64] Part-5:add loongarch support in some files for LoongArch64. (#21769)
[mono-project.git] / mcs / tests / test-pattern-09.cs
blob801469e32104894572df5f8054aae80cd05ba656
1 using System.Collections.Generic;
3 class Expr
5 public int Field;
8 static class X
10 public static IEnumerable<int> Test (Expr expr)
12 object exprCur = expr;
13 if (exprCur is Expr list) {
14 yield return list.Field;
18 public static IEnumerable<string> Test2 (int? expr)
20 int? exprCur = expr;
21 while (exprCur != null) {
22 if (exprCur is int list) {
23 yield return list.ToString ();
28 public static void Main ()
30 Test (null);
31 Test2 (3);