[SR-4758] SE-0142: derived protocol that restricts associatedtype should be allowed as a variable type #47335
Labels
compiler
The Swift compiler in itself
existentials
Feature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased values
feature
A feature request or implementation
improvement
swift evolution implemented
Flag → feature: A feature that was approved through the Swift evolution process and implemented
type checker
Area → compiler: Semantic analysis
Environment
Swift Development Snapshot 2017-04-24 (a)
Xcode 8.3.2
macOS Sierra 10.12.4
Additional Detail from JIRA
md5: 992bea1bd30120d41ee308b8b85d8e1e
is duplicated by:
relates to:
Issue Description:
With the implementation of SE-0142, it is now possible to force the associated types of a derived protocol to be of a specific type.
Arguably, when all the associated types are restricted, it should be possible to use the derived protocol as the type of a variable. However, the compiler still rejects the code.
Example:
In the example above, protocol C has no degrees of freedom so it shouldn't need to be restricted to generic code.
The text was updated successfully, but these errors were encountered: