linux-packaging-mono/mono/tests/nullable_boxing.2.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

26 lines
436 B
C#

using System;
public class Program {
internal class Button : ContextBoundObject
{
public int Counter (int? x)
{
if (x == null)
return 0;
return x.Value + 1;
}
public static Button TheButton = new Button ();
}
public static int Main ()
{
// Test remoting and nullables
if (Button.TheButton.Counter (1) != 2)
return 1;
int?[] x = new int?[] { null };
return x.GetValue (0) == null ? 0 : 2;
}
}