-
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.compilerThe Swift compiler itselfThe Swift compiler itself
Description
| Previous ID | SR-7353 |
| Radar | rdar://problem/39225307 |
| Original Reporter | @jepers |
| Type | Bug |
| Status | Resolved |
| Resolution | Done |
Environment
Xcode 9.3, default toolchain and eg dev snapshot 2018-03-28
Additional Detail from JIRA
| Votes | 0 |
| Component/s | Compiler |
| Labels | Bug |
| Assignee | None |
| Priority | Medium |
md5: c26cdc0dbaf628a2e81a170395fe5d27
Issue Description:
Note that the following compiles as expected (in Xcode 9.3):
protocol P {
associatedtype A: Q where A.B == Self
}
protocol Q {
associatedtype B: P where B.A == Self
}
But adding a second associated type `C` to `Q` will produce the following invalid error and warning:
protocol P {
associatedtype A: Q where A.B == Self
}
protocol Q {
associatedtype B: P where B.A == Self
associatedtype C: P where C.A == Self // Error and Warning
}
// Error: `A` is not a member of type `Self.C`
// Warning: Redundant conformance constraint 'Self.C': 'P'
BUT: The error goes away (but not the warning) if the protocol definitions are swapped, so that Q is defined before P. Also, there is no error when using eg dev snapshot 2018-03-28, no matter the order of P and Q.
Metadata
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.compilerThe Swift compiler itselfThe Swift compiler itself