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
2007-05-25 Jonathan Chambers <joncham@gmail.com>
[mcs.git]
/
tests
/
gtest-136.cs
blob
fbef3ced10b28139d88cb82e6094adba25554b15
1
using
System
;
2
3
namespace
Martin
{
4
public struct
A
5
{
6
public readonly long
Data
;
7
8
public
A
(
long
data
)
9
{
10
this
.
Data
=
data
;
11
}
12
13
public static explicit operator
B
(
A a
)
14
{
15
return new
B
((
int
)
a
.
Data
);
16
}
17
}
18
19
public struct
B
20
{
21
public readonly int
Data
;
22
23
public
B
(
int
data
)
24
{
25
this
.
Data
=
data
;
26
}
27
28
public static implicit operator
A
(
B b
)
29
{
30
return new
A
(
b
.
Data
);
31
}
32
}
33
34
class
X
35
{
36
static void
Main
()
37
{
38
B
?
b
=
new
B
(
5
);
39
A
?
a
=
b
;
40
B
?
c
= (
B
?)
a
;
41
B
?
d
= (
Martin
.
B
?)
a
;
42
}
43
}
44
}