blob: b0d59895a25f9624c6a35f5ab8b7a2624939a911 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
using System.Collections;
class P {
public int x;
}
struct Q {
public P p;
public Q (P p) { this.p = p; }
}
class Test {
static IEnumerable foo () { return null; }
public static void Main ()
{
IEnumerable f = foo ();
if (f != null)
foreach (P p in f)
p.x = 0;
if (f != null)
foreach (Q q in f)
q.p.x = 0;
}
}
|