repo.or.cz
/
mcs.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Warnings cleanup
[mcs.git]
/
tests
/
test-261.cs
blob
014f2e05f07e4f71e4cd20819815c1fa02e35308
1
using
System
;
2
3
class
T
{
4
T Me { get { calls ++; return this; }
}
5
T
GetMe
()
{ foo ++; return this; }
6
int
blah
=
0
,
calls
=
0
,
foo
=
0
,
bar
=
0
;
7
8
static int
Test
(
T t
)
9
{
10
t
.
Me
.
Me
.
blah
++;
11
t
.
GetMe
().
GetMe
().
bar
++;
12
if
(
t
.
blah
!=
1
)
13
return
1
;
14
if
(
t
.
bar
!=
1
)
15
return
2
;
16
if
(
t
.
calls
!=
2
)
17
return
3
;
18
if
(
t
.
foo
!=
2
)
19
return
4
;
20
return
0
;
21
}
22
23
static int
Main
()
24
{
25
T t
=
new
T
();
26
int
result
=
Test
(
t
);
27
Console
.
WriteLine
(
"RESULT:
{0}
"
,
result
);
28
return
result
;
29
}
30
}