So I have a method that has 3 different types of arguments that could come in:
Int32, Int and Double. So the idea was to use
... because there is no initializer for Double that takes a Generic.
That is not entirely true. There is no initializer taking a Numeric argument. But there are generic initializers taking BinaryInteger and BinaryFloatingPoint arguments, so that two overloads are sufficient:
func resetProgressBarChunks(originalIterationCount: T) {
let iCount = Double(originalIterationCount)
// ...
}
func resetProgressBarChunks(originalIterationCount: T) {
let iCount = Double(originalIterationCount)
// ...
}
This covers Double, Int, Int32 arguments as well as Float and all other fixed-size integer types.