mirror of
https://github.com/apple/swift.git
synced 2026-10-02 10:58:03 +02:00
We need to start moving people over to using the version of suppressed associated types that has the officially accepted behavior according to SE-503, and that is via `SuppressedAssociatedTypesWithDefaults`. To allow for time to migrate to the new version, I'm introducing the deprecation message as a warning for now. This set of changes also moves most of the test suite over to using the officially accepted version. rdar://172231663
23 lines
876 B
Swift
23 lines
876 B
Swift
// RUN: %target-typecheck-verify-swift \
|
|
// RUN: -enable-experimental-feature SuppressedAssociatedTypesWithDefaults
|
|
|
|
// REQUIRES: swift_feature_SuppressedAssociatedTypesWithDefaults
|
|
|
|
struct Turtle<T> {}
|
|
extension Turtle where T: ~Copyable {} // expected-error {{'T' required to be 'Copyable' but is marked with '~Copyable'}}
|
|
|
|
struct Rabbit<T> where T: ~Copyable {}
|
|
extension Rabbit where T: ~Escapable {} // expected-error {{'T' required to be 'Escapable' but is marked with '~Escapable'}}
|
|
|
|
protocol P {}
|
|
extension P where Self: ~Escapable {} // expected-error {{'Self' required to be 'Escapable' but is marked with '~Escapable'}}
|
|
|
|
protocol HasAssoc {
|
|
associatedtype A
|
|
}
|
|
extension HasAssoc where Self.A: ~Copyable {}
|
|
// expected-error@-1 {{'Self.A' required to be 'Copyable' but is marked with '~Copyable'}}
|
|
|
|
class Box<T: ~Copyable> {}
|
|
extension Box where T: ~Copyable {}
|