[swift-evolution] [swift-evolution-announce] [Review] SE-0080: Failable Numeric Conversion Initializers

Colin Barrett colin at springsandstruts.com
Wed May 4 18:56:37 CDT 2016


> Swift numeric types all currently have a family of conversion initializers. In many use cases they leave a lot to be desired. Initializing an integer type with a floating point value will truncate any fractional portion of the number. Initializing with an out-of-range value traps.


Have you considered whether it makes sense to keep these around? Maybe the failable ones should be the default, and give the other ones a more descriptive 1st argument label.

-Colin


More information about the swift-evolution mailing list