mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Requirement lowering only expects that it won't see two requirements of the same kind (except for conformance requirements). So only mark those as conflicting. This addresses a crash-on-invalid and improves diagnostics for move-only generics, because a conflict won't drop the copyability of a generic parameter and expose a move-only-naive user to confusing error messages. Fixes #61031. Fixes #63997. Fixes rdar://problem/111991454.
8 lines
267 B
Swift
8 lines
267 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
protocol P {
|
|
associatedtype A : P where A.X == Self
|
|
associatedtype X : P where P.A == Self
|
|
// expected-error@-1{{cannot access associated type 'A' from 'P'; use a concrete type or generic parameter base instead}}
|
|
}
|