[SR-13090] Runtime crash when conforming to unavailable protocol (Identifiable) #55536
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
type checker
Area → compiler: Semantic analysis
Attachment: Download
Environment
Xcode 11.5 and Xcode 12 beta 1
Swift 5.1 and 5.3
Additional Detail from JIRA
md5: fb7f8d30c8452a22e9ddddbf84515984
Issue Description:
It's possible to build and run code (without warnings) where a type conforms to a protocol that isn't available for a deployment target which then crashes at runtime.
My example uses an `Identifiable` conformance in an app with an iOS 12 deployment target.
It seems like the line `struct Store<T> where T: Animal` should be generating a compile error like: `'Animal' is only available in iOS 13 or newer`.
Edit: See sample project. Couldn't get code formatted properly. The app crashes when run on the iOS 12 simulator.
The text was updated successfully, but these errors were encountered: