Understanding SE-0346: Can P<T> be Used for Protocol Conformance?

In SE-0346, it is said that

In the inheritance clause of a concrete type, for example:

struct Lines : Collection<String> { ... }

In this position it is sugar for specifying the associated type witness, similar to explicitly declaring a typealias:

struct Lines : Collection {
  typealias Element = String
}

It seems that in 'three other positions' the proposal mentions, only this usage cannot be compiled in Swift 5.8.

protocol P<T> {
    associatedtype T
}
// Cannot inherit from protocol type with generic argument 'P<Int>'
struct F: P<Int> {
    typealias T = Int
}

I'd like to clarify that whether this is due to a bug, or this is just not implemented, or this is an expected behavior. Does anyone know what is happening here?

2 Likes

Reported as an issue :slight_smile:

2 Likes