Re: [swift-users] Strange Error about Default values

2017-01-18 Thread Zhao Xin via swift-users
Maybe what you want is struct S1 { private var _v = 1 var v:Int { get { return self._v } } } Zhaoxin On Thu, Jan 19, 2017 at 2:08 AM, Jordan Rose via swift-users < swift-users@swift.org> wrote: > It is a terrible error message, though. I've filed SR-367

Re: [swift-users] Strange Error about Default values

2017-01-18 Thread Jordan Rose via swift-users
It is a terrible error message, though. I've filed SR-3671 to improve it. Thanks, LiMing (and Adrian). Jordan > On Jan 18, 2017, at 07:29, Adrian Zubarev via swift-users > wrote: > > Computed properties do not have any default values. That said, you c

Re: [swift-users] Strange Error about Default values

2017-01-18 Thread Adrian Zubarev via swift-users
Computed properties do not have any default values. That said, you can only use didSet or willSet on properties like yours to observe them or remove the default value from the computed property completely to use get and set. --  Adrian Zubarev Sent with Airmail Am 18. Januar 2017 um 15:06:16,