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
bring Mono Security to monotouch
[mcs.git]
/
tests
/
test-123.cs
blob
a27c805c3c4bdfc11ff27bac1cf3e22ff6186859
1
class
X
{
2
3
static object
get_non_null
()
4
{
5
return new
X
();
6
}
7
8
static object
get_null
()
9
{
10
return null
;
11
}
12
13
static int
Main
()
14
{
15
int
a
=
5
;
16
object
o
;
17
decimal
d
=
0
M
;
18
19
//
20
// compile time
21
//
22
if
(!(
get_non_null
()
is object
))
23
return
1
;
24
25
if
(
get_null
()
is object
)
26
return
2
;
27
28
if
(!(
a
is object
))
29
return
3
;
30
31
//
32
// explicit reference
33
//
34
if
(
null is object
)
35
return
4
;
36
37
o
=
a
;
38
if
(!(
o
is int
))
39
return
5
;
40
41
if
(
d
is int
)
42
return
6
;
43
44
object
oi
=
1
;
45
if
(!(
oi
is int
))
46
return
7
;
47
48
System
.
Console
.
WriteLine
(
"Is tests pass"
);
49
return
0
;
50
}
51
}