Compile Time vs. Run Time Type Checking in Swift

Benjamin Encz: The dynamic type check in the above example actually works correctly. The body of the if let block is only executed for types that conform to our two expected protocols. However, we cannot convey this to the compiler. The compiler expects a concrete type (one that has a fully specified type at compile … Continue reading Compile Time vs. Run Time Type Checking in Swift