projects
/
mono.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Merge pull request #5560 from kumpera/wasm-work-p3
[mono.git]
/
mcs
/
tests
/
test-903.cs
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
}