repo.or.cz
/
mono-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[genproj] Sort embedded resources by name
[mono-project.git]
/
mcs
/
tests
/
test-pattern-08.cs
blob
22b76219c0cc72e3c447cad880851bf4f7919d04
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
}