[SR-4694] Subtyping Properties and Return Types for Protocol Conformance #47271
Labels
compiler
The Swift compiler in itself
conformances
Feature → protocol: protocol conformances
duplicate
Resolution: Duplicates another issue
feature
A feature request or implementation
improvement
protocol
Feature → type declarations: Protocol declarations
type checker
Area → compiler: Semantic analysis
Additional Detail from JIRA
md5: d8be69378d06edc0fb0afb6caecc6493
duplicates:
Issue Description:
Subtyping a property or a return type in a Protocol conforming type is not possible in Swift 3.1
Example:
Since Stub conforms to MyType it is possible to set property a in TestA to a Stub (or return a Stub in getA). So far so good. But it is not possible to specify the property or the return type in a HasMyType-conforming Type to a concrete subtype of MyType.
For Example you setup a testcase and use a Stub as your implementation of MyType and want to refer to functions and properties only visible in Stub.
Compiler Output:
The text was updated successfully, but these errors were encountered: