[SR-4103] Allow protocol conformance by promoting property getter of type T to T? #46686
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: 64f4cc77ff7834aa2d84df3814458644
duplicates:
Issue Description:
Hello! I think I should be allowed to do this:
because I can usually assign or pass a
T
anywhere anOptional<T>
is required. But instead I get a compile error:This would only be allowed if the protocol specifies a non-settable property. If the protocol requires a setter then a compile error is still appropriate.
The text was updated successfully, but these errors were encountered: