[SR-10713] The dynamic nature of a protocol's Self type isn't checked when equated with another associated type #53110
Labels
accepts invalid
Bug: Accepts invalid
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
type checker
Area → compiler: Semantic analysis
Environment
Swift version 5.1-dev (LLVM 082dec2e22, Swift 397965d3fc)
Target: x86_64-apple-darwin18.5.0
Additional Detail from JIRA
md5: 68e52fe5d63fd695a13a186f306cb4bc
Issue Description:
The following unsound code is allowed to compile, which lets us turn a subclass instance into a superclass instance:
When checking the constraint
X == Self
, we should treatSelf
as being the dynamic self and therefore reject the conformance.The text was updated successfully, but these errors were encountered: