You've already forked linux-packaging-mono
Imported Upstream version 3.8.0
Former-commit-id: 6a76a29bd07d86e57c6c8da45c65ed5447d38a61
This commit is contained in:
73
mcs/tests/gtest-618.cs
Normal file
73
mcs/tests/gtest-618.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
|
||||
struct S1
|
||||
{
|
||||
public static implicit operator int (S1? s)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
struct S2
|
||||
{
|
||||
public static implicit operator int? (S2? s)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
struct S3
|
||||
{
|
||||
public static implicit operator int? (S3? s)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
struct S4
|
||||
{
|
||||
public static implicit operator int? (S4 s)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
class C
|
||||
{
|
||||
public static int Main ()
|
||||
{
|
||||
S1? s1 = new S1 ();
|
||||
switch (s1) {
|
||||
case 1:
|
||||
break;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
|
||||
S2? s2 = new S2 ();
|
||||
switch (s2) {
|
||||
case null:
|
||||
break;
|
||||
default:
|
||||
return 2;
|
||||
}
|
||||
|
||||
S3? s3 = new S3 ();
|
||||
switch (s3) {
|
||||
case 2:
|
||||
break;
|
||||
default:
|
||||
return 3;
|
||||
}
|
||||
|
||||
S4 s4 = new S4 ();
|
||||
switch (s4) {
|
||||
case 3:
|
||||
break;
|
||||
default:
|
||||
return 4;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user