[SR-11398] Self type does not behave correctly in subclasses of a protcol implementation #53799
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Attachment: Download
Environment
Xcode 11.0 beta 6 (11M392r)
Apple Swift version 5.1 (swiftlang-1100.0.270.6 clang-1100.0.32.1)
macOS 10.14.6 (18G95)
Additional Detail from JIRA
md5: 7bbc923a93acf7925ca4d3fc49375d04
duplicates:
Issue Description:
Note: please open the attached code sample and have a look at the README
The following code defines a simple
SomeProtocol
with a static var definitionsvar
.A default implementation of svar is provided via extension, along with an instance method that prints its value via
Self
.Considering the following class hierarchy of protocol adoption class:
we have an inconsistency if we try to execute the following code:
According to the official Self type documentation the two outputs should be the same:
A more thorough explanation of the wrong behavior is provided in the attached sample project.
The text was updated successfully, but these errors were encountered: