Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

38 lines
482 B
C#

using System;
using System.Linq.Expressions;
public struct MyType
{
int value;
public MyType (int value)
{
this.value = value;
}
public static MyType operator - (MyType a)
{
return new MyType (-a.value);
}
}
class C
{
public static int Main ()
{
MyType? x = null;
MyType? y = -x;
checked {
float? f = float.MinValue;
f = -f + 1;
int? i = int.MinValue;
try {
i = -i;
return 1;
} catch (OverflowException) { }
}
return 0;
}
}