> On Apr 29, 2016, at 1:23 PM, Haravikk via swift-evolution
> <[email protected]> wrote:
>
> This is definitely something I’m hoping to see as well, alongside more
> intelligent handling of the is keyword, as currently Swift doesn’t handle the
> following either:
>
> if foo is SomeType { /* foo could be safely used as SomeType here, but
> currently is not */ }
>
> Hopefully someone more familiar can weigh in, as it seems like something I
> expect to be on the way but perhaps has been delayed in case any further
> changes to the type system were required?
This can be handled with the if-let syntax:
if let foo = foo as? SomeType { … }
although I think your idea is more readable.
- Dave Sweeris_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution