given a type like
public
struct IntegerOverflowError:Error, Sendable
{
public
let number:Number
public
let overflows:any FixedWidthInteger.Type
}
why does this work?
extension IntegerOverflowError:Equatable
{
public static
func == (lhs:Self, rhs:Self) -> Bool
{
Self.eq(lhs: lhs, number: rhs.number, overflows: rhs.overflows)
}
private static
func eq<Integer>(lhs:Self, number:Number,
overflows _:Integer.Type) -> Bool
where Integer:FixedWidthInteger
{
lhs.number == number && lhs.overflows is Integer.Type
}
but not this?
private static
func eq2<Integer>(lhs:Self,
rhs:(number:Number, _:Integer.Type)) -> Bool
where Integer:FixedWidthInteger
{
lhs.number == rhs.number && lhs.overflows is Integer.Type
}
}