[swift-evolution] guard let x = x

Martin Waitz tali at admingilde.org
Fri Nov 4 04:37:47 CDT 2016


Am 2016-11-04 06:55, schrieb Thorsten Seitz:
> vars cannot be type narrowed as soon as concurrency comes into play.
> That's why Ceylon restricts type narrowing to immutables.

Are you afraid that your variable gets changed under your feet and 
afterwards does not conform to the narrowed type any more?

In this case, you have to resort to locks or local copies anyway, even 
without type narrowing.
But you are right, type narrowing could transform a simple data race 
into a fatalError.

-- 
Martin


More information about the swift-evolution mailing list