public static bool IsIntegralMinusOne(ICompileTimeConstant constExpression) {
IConvertible/*?*/ ic = constExpression.Value as IConvertible;
if (ic == null) return false;
switch (ic.GetTypeCode()) {
case System.TypeCode.SByte: return ic.ToSByte(null) == -1;
case System.TypeCode.Int16: return ic.ToInt16(null) == -1;
case System.TypeCode.Int32: return ic.ToInt32(null) == -1;
case System.TypeCode.Int64: return ic.ToInt64(null) == -1;
case System.TypeCode.Byte: return ic.ToByte(null) == byte.MaxValue;
case System.TypeCode.UInt16: return ic.ToUInt16(null) == ushort.MaxValue;
case System.TypeCode.UInt32: return ic.ToUInt32(null) == uint.MaxValue;
case System.TypeCode.UInt64: return ic.ToUInt64(null) == ulong.MaxValue;
}
return false;
}