<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Are you thinking of something along the lines of is proposal?<div class=""><br class=""></div><div class=""><a href="https://github.com/apple/swift-evolution/pull/58" class="">https://github.com/apple/swift-evolution/pull/58</a></div><div class=""><br class=""></div><div class="">It has been sitting as a PR for quite a while and not been merged yet.&nbsp;</div><div class=""><br class=""></div><div class="">-Matthew</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 12, 2016, at 11:21 AM, Félix Cloutier via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">It appears that the current integer conversion initializers will either always work, possibly trap, or truncate:</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class="">init(_: Int)<br class="">init(_: Int8)<br class="">init(_: Int16)<br class="">init(_: Int32)<br class="">init(_: Int64)<br class="">init(_: UInt)<br class="">init(_: UInt8)<br class="">init(_: UInt16)<br class="">init(_: UInt32)<br class="">init(_: UInt64)<br class="">init(truncatingBitPattern: Int)<br class="">init(truncatingBitPattern: Int16)<br class="">init(truncatingBitPattern: Int32)<br class="">init(truncatingBitPattern: Int64)<br class="">init(truncatingBitPattern: UInt)<br class="">init(truncatingBitPattern: UInt16)<br class="">init(truncatingBitPattern: UInt32)<br class="">init(truncatingBitPattern: UInt64)<br class=""></blockquote><div class=""><br class="webkit-block-placeholder"></div><div class="">I suggest that we change trapping initializers to failable initializers. Initializers that can't fail (identity, unsigned -&gt; bigger signed/unsigned, signed -&gt; bigger signed) should keep a non-Optional type.</div><div class=""><br class=""></div><div class="">This could extend to changing SignedIntegerType's and UnsignedIntegerType's (U)IntMax to failable initializers as well.</div><div class=""><br class="webkit-block-placeholder"></div><div class="">I think I remember someone on the core team saying that someone's working on integer types at the moment. Is that right?</div><div class="">
<br class="Apple-interchange-newline"><span style="font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Félix</span>
</div>

<br class=""></div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></body></html>