On 12 Sep 2016, at 06:40, Jacob Bandes-Storch via swift-users
<[email protected]> wrote:
> I'd recommend filing a bug at bugs.swift.org.
Agreed.
Also, you can work around this by adding a type.
lazy var myQ: DispatchQueue = DispatchQueue(label: "Op", attributes:
.concurrent)
Also, with regards this specific example, be aware that lazy properties aren’t
guaranteed to be initialised only once. To quote “The Swift Programming
Language”:
If a property marked with the `lazy` modified is accessed by multiple
threads simultaneously and the property has not yet been initialized,
there is no guarantee that the property will be initialized only once.
I’m struggling to think of a case where that limitation is acceptable in the
context of a dispatch queue (-:
Share and Enjoy
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
swift-users mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-users