@Félix,

For the first point, the issue you talked about isn't new. We can enter
into that mess easily right now just by changing `let` to `var`.

For the second point, well.. I agree with you and @Michel, thank you guys.
It do make sense, I should've noticed it earlier. This is not an
appropriate solution to make the current "didSet" keyword available for
`let` property.

But I'm still thinking it should not be a problem at all if we add
something new, such as "didInit", which only get called for the very first
time when property is assigned a value.

What do you think?



On Wed, Dec 23, 2015 at 7:39 PM, Michel Fortin <[email protected]>
wrote:

> Le 23 déc. 2015 à 11:07, Félix Cloutier via swift-evolution <
> [email protected]> a écrit :
>
> > willSet and didSet are currently not even called from the init method.
>
> And they can't, because in those two blocks you have access to the old
> value as well as the new value. How would that work when you're setting the
> initial value?
>
>         var value: Int {
>                 willSet { print("willSet \(value) -> \(newValue)") }
>                 didSet { print("didSet \(oldValue) -> \(value)") }
>         }
>
>
> --
> Michel Fortin
> https://michelf.ca
>
>
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to