@@ -35,7 +35,8 @@ protocol Rope<Element>: ~Copyable { // expected-error {{cannot suppress conforma
35
35
extension S : ~ Copyable { } // expected-error {{cannot suppress conformances here}}
36
36
// expected-error@-1 {{cannot find type 'Copyable' in scope}}
37
37
38
- func takeNoncopyableGeneric< T: ~ Copyable> ( _ t: T ) { } // expected-error {{expected a class type or protocol-constrained type restricting 'T'}}
38
+ func takeNoncopyableGeneric< T: ~ Copyable> ( _ t: T ) { } // expected-error {{cannot suppress conformances here}}
39
+ // expected-error@-1 {{cannot find type 'Copyable' in scope}}
39
40
40
41
@_moveOnly struct ExtraNonCopyable : // expected-error {{duplicate attribute}}{{1-12=}}
41
42
~ Copyable // expected-note {{attribute already specified here}}
@@ -57,3 +58,24 @@ public enum MoveOnlyE2<T: Equatable> : ~Copyable {
57
58
case holding( s: MoveOnlyS1 < T > )
58
59
consuming func x( ) { }
59
60
}
61
+
62
+ func more( ) {
63
+ let foo: any ~ Copyable = 19 // expected-error@:16 {{cannot suppress conformances here}}
64
+ // expected-error@-1 {{cannot find type 'Copyable' in scope}}
65
+
66
+ let foo: any ~ Equatable = 19 // expected-error@:16 {{cannot suppress conformances here}}
67
+ }
68
+
69
+ func blah< T> ( _ t: T ) where T: ~ Copyable, // expected-error@:31 {{cannot suppress conformances here}}
70
+ // expected-error@-1 {{cannot find type 'Copyable' in scope}}
71
+
72
+ T: ~ Hashable { } // expected-error@:31 {{cannot suppress conformances here}}
73
+
74
+ func foo< T: ~ Copyable> ( x: T ) { } // expected-error {{cannot suppress conformances here}}
75
+ // expected-error@-1 {{cannot find type 'Copyable' in scope}}
76
+
77
+ struct Buurap < T: ~ Copyable> { } // expected-error {{cannot suppress conformances here}}
78
+ // expected-error@-1 {{cannot find type 'Copyable' in scope}}
79
+
80
+ protocol Foo where Self: ~ Copyable { } // expected-error {{cannot suppress conformances here}}
81
+ // expected-error@-1 {{cannot find type 'Copyable' in scope}}
0 commit comments