[swift-users] Convenience initializers in structs?
jens at bitcycle.com
Tue Jul 18 08:46:07 CDT 2017
Start a command line project in Xcode 9 beta 3 and copy paste this single
line of code into main.swift
let _ = UInt8.init(extendingOrTruncating: UInt64(123456))
Now look at Quick Help while placing the cursor on `init` and then on
Note that (and how) the documentation for the initializer differs depending
on where you place the cursor.
If the cursor is on `init`, the initializer is shown to be a convenience(!)
initializer even though structs (such as UInt8) cannot have convenience
Even the official documentation for this and several other initializer like
clearly shows convenience initializers in structs.
By the way, .init(extendingOrTruncating:) doesn't show in the list of
completions for "UInt8.init" but it does for "UInt8(".
Can anyone explain what's going on?
Are these known issues that will go away in time for Xcode 9 GM?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-users