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
Merge pull request #1861 from saper/home-override
[mono-project.git]
/
mcs
/
tests
/
gtest-462.cs
blob
74bd6b743fd81c7e080844c03f4145003754babd
1
using
System
;
2
3
class
Program
4
{
5
public static int
Main
()
6
{
7
Tester
<
int
>
t
=
new
Tester
<
int
> ();
8
int
r
=
t
.
Get
(
333
);
9
Console
.
WriteLine
(
r
);
10
if
(
r
!=
333
)
11
return
1
;
12
13
r
=
t
.
Get
(
222.12
);
14
Console
.
WriteLine
(
r
);
15
if
(
r
!=
0
)
16
return
2
;
17
18
return
0
;
19
}
20
21
class
Tester
<
T
>
where T
:
struct
,
IConvertible
22
{
23
public
T
Get
(
object
data
)
24
{
25
var
val
=
data
;
26
if
(
val
is
T
)
27
return
(
T
)
val
;
28
return default
(
T
);
29
}
30
}
31
}