blob: d5c83a033f9cbe9bbf5ddc45cc7d0b817684ddc5 (
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
using System;
struct S2
{
public float f1;
}
struct S
{
public S2 s2;
public float F;
}
class C
{
static void Test (bool b, out S s)
{
if (b) {
s.s2 = new S2 ();
s.F = 1.0f;
} else {
s.s2.f1 = 2.1f;
s.F = 1.0f;
}
}
static void Test2 (bool b)
{
S s;
if (b) {
s.s2 = new S2 ();
s.F = 1.0f;
} else {
s.s2.f1 = 2.1f;
s.F = 1.0f;
}
}
public static int Main ()
{
S s;
Test (true, out s);
Test (false, out s);
return 0;
}
}
|