6bdd276d05
Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
35 lines
456 B
C#
35 lines
456 B
C#
using System;
|
|
|
|
class X
|
|
{
|
|
static int Main ()
|
|
{
|
|
int? intArg = 1;
|
|
long? longArg = 2;
|
|
|
|
var g = intArg ?? longArg;
|
|
Console.WriteLine (g);
|
|
if (g != 1)
|
|
return 1;
|
|
|
|
intArg = null;
|
|
g = intArg ?? longArg;
|
|
Console.WriteLine (g);
|
|
if (g != 2)
|
|
return 2;
|
|
|
|
longArg = null;
|
|
g = intArg ?? longArg;
|
|
Console.WriteLine (g);
|
|
if (g != null)
|
|
return 3;
|
|
|
|
return 0;
|
|
}
|
|
|
|
const Action cf = null;
|
|
void Foo (Action f)
|
|
{
|
|
var x = f ?? cf;
|
|
}
|
|
} |