[SR-14467] Protocol inheritance with optional covariance does not produce compiler error #56823
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
macOS 11.2.3
Apple Swift version 5.4 (swiftlang-1205.0.24.6 clang-1205.0.19.54)
Target: x86_64-apple-darwin20.3.0
Xcode 12.5 Beta 2 (12E5234g)
Additional Detail from JIRA
md5: 4faca14f1ca51cfa8c832fdfacab5415
Issue Description:
When you have the following protocol structure
The compiler does not provide an error at the definition of the protocol.
It's not until you try conforming to it do you get conflicting and unresolvable compiler errors:
I would expect the compiler to catch this covariance issue with Optional and throw an error at the protocol declaration
The text was updated successfully, but these errors were encountered: