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
update readme (#21797)
[mono-project.git]
/
mcs
/
tests
/
test-903.cs
blob
7dedb674dafaa35d46aef4ffef41b6aa8c531353
1
using
System
;
2
3
struct
S
4
{
5
}
6
7
class
C
8
{
9
public static int
ConversionCalled
;
10
11
public static implicit operator
S
(
C c
)
12
{
13
++
ConversionCalled
;
14
return new
S
();
15
}
16
}
17
18
class
Program
19
{
20
static
C field
;
21
22
static int
Main
()
23
{
24
C c
=
new
C
();
25
var
x
=
c
??
new
S
();
26
27
if
(
C
.
ConversionCalled
!=
1
)
28
return
1
;
29
30
c
=
null
;
31
x
=
c
??
new
S
();
32
if
(
C
.
ConversionCalled
!=
1
)
33
return
2
;
34
35
x
=
field
??
new
S
();
36
if
(
C
.
ConversionCalled
!=
1
)
37
return
3
;
38
39
return
0
;
40
}
41
}