using System.Numerics;
short a = 32767;
short b = 32767;
short result = GenericChecked<short>(a, b);
T GenericChecked<T>(T a, T b) where T : INumber<T>
{
return checked(T.CreateChecked(a + b)); // Does not throw, returns -2 instead.
}