[swift-evolution] Implicit truncation

Guillaume Lessard glessard at tffenterprises.com
Tue May 23 17:27:04 CDT 2017

> On May 23, 2017, at 13:25, Xiaodi Wu <xiaodi.wu at gmail.com> wrote:
> The doc comments in the proposal text were meant as explanation for readers of the proposal; they undergo editing for accuracy during implementation. That wording is, notably, not found in the implemented protocol. 

What? It shows up in my browser! This is how it looks right now: (in https://github.com/apple/swift/blob/368847b5c7581b9024347f0a73fc83eb6d9866a8/stdlib/public/core/Integers.swift.gyb#L1366)

/// Creates an integer from the given floating-point value, truncating any
/// fractional part.
/// Truncating the fractional part of `source` is equivalent to rounding
/// toward zero.

Let’s not cherry-pick.

Is there another lossy initializer for Int or BinaryInteger that doesn’t have a parameter label?


More information about the swift-evolution mailing list