You've already forked linux-packaging-mono
Imported Upstream version 5.8.0.22
Former-commit-id: df344e34b07851d296efb3e6604c8db42b6f7aa3
This commit is contained in:
parent
5f4a27cc8a
commit
7d05485754
32
mcs/tests/test-pattern-08.cs
Normal file
32
mcs/tests/test-pattern-08.cs
Normal file
@ -0,0 +1,32 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
class Expr
|
||||
{
|
||||
public int Field;
|
||||
public Expr Next;
|
||||
}
|
||||
|
||||
static class X
|
||||
{
|
||||
public static IEnumerable<int> Test (this Expr expr)
|
||||
{
|
||||
var exprCur = expr;
|
||||
while (exprCur != null)
|
||||
{
|
||||
if (exprCur is Expr list)
|
||||
{
|
||||
yield return list.Field;
|
||||
exprCur = list.Next;
|
||||
}
|
||||
else
|
||||
{
|
||||
yield return 2;
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Main ()
|
||||
{
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user