On 12 Sep 2016, at 08:28, Zhao Xin <owe...@gmail.com> wrote:

> It is not a bug. 

I disagree.

> You must explicitly specify the variable's type if you use `lazy` keyword.


No, that’s not the case in general.  For example, the following code compiles 
just fine.

  import Dispatch

  func queueMaker() -> DispatchQueue {
    return DispatchQueue(label: "Op", attributes: .concurrent)
  }

  class MyClass {
    lazy var myQ = queueMaker()
  }

Regardless, there’s two possibilities here:

A. this is a real restriction in the language, which makes the poor diagnostic 
bugworthy

B. this is a false restriction, which makes it bugworthy in and of itself

While I personally believe that B is the case here, that’s really besides the 
point; something, either A or B, should change, and hence my advice.

Share and Enjoy
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to