> The casting pushes type errors to execution-time rather than compile-time
Which is exactly what pattern matching does, which is what I was responding about.
Which is exactly what pattern matching does, which is what I was responding about.
Edit ( since i can't reply) : just look at https://developer.apple.com/library/content/documentation/Sw... with something like the barcode example.
It's all compile time checked.
Sooo just accessing fields on a struct? I don't understand the distinction you are trying to make.
The complexity is inherent and you can either choose to make it implicit and play the losing game of ensuring it doesn't fail with tests or make it explicit from the outset.