-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Description
| Previous ID | SR-14917 |
| Radar | rdar://problem/80820294 |
| Original Reporter | @jepers |
| Type | Bug |
| Status | Resolved |
| Resolution | Done |
Environment
macOS 11.3, Xcode 12.5 and 12.5.1
Additional Detail from JIRA
| Votes | 0 |
| Component/s | |
| Labels | Bug |
| Assignee | None |
| Priority | Medium |
md5: 5107e4b57e6a7f5c8dd5e4d6703b74f3
Issue Description:
This compiles with the expected warning:
struct S<T: Collection> where T.Index == T.Indices.Index {} // Warning: Redundant same-type constraint `T.Index` == `T.Indices.Index`But this compiles without any warning:
extension Collection where Self.Index == Self.Indices.Index {} // No warningI would have expected the same warning here.
This inconsistent behaviour is reproduced by eg:
protocol P {
associatedtype A
associatedtype AS: Q where AS.B == A
}
protocol Q {
associatedtype B
}
struct S<T: P> where T.AS.B == T.A {} // Warning as expected
extension P where AS.B == A {} // No warningMetadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.