|
| 1 | +// RUN: %target-typecheck-verify-swift |
1 | 2 | // RUN: %target-typecheck-verify-swift -enable-experimental-feature NoncopyableGenerics
|
2 | 3 |
|
3 | 4 | // a concrete move-only type
|
@@ -289,31 +290,3 @@ func doBadMetatypeStuff<T>(_ t: T) {
|
289 | 290 | func tryToDoBadMetatypeStuff() {
|
290 | 291 | doBadMetatypeStuff(MO.self)
|
291 | 292 | }
|
292 |
| - |
293 |
| -func totallyInvalid<T>(_ t: T) where MO: ~Copyable {} |
294 |
| -// expected-error@-1{{type 'MO' in conformance requirement does not refer to a generic parameter or associated type}} |
295 |
| - |
296 |
| -func packingHeat<each T>(_ t: repeat each T) {} // expected-note {{generic parameter 'each T' has an implicit Copyable requirement}} |
297 |
| -func packIt() { |
298 |
| - packingHeat(MO()) // expected-error {{noncopyable type 'MO' cannot be substituted for copyable generic parameter 'each T' in 'packingHeat'}} |
299 |
| - packingHeat(10) |
300 |
| -} |
301 |
| - |
302 |
| -func packingUniqueHeat_1<each T: ~Copyable>(_ t: repeat each T) {} |
303 |
| -// expected-error@-1{{cannot apply inverse '~Copyable' to type 'each T' in conformance requirement}} |
304 |
| -// expected-note@-2{{generic parameter 'each T' has an implicit Copyable requirement}} |
305 |
| - |
306 |
| -func packingUniqueHeat_2<each T>(_ t: repeat each T) |
307 |
| - where repeat each T: ~Copyable {} |
308 |
| -// expected-error@-1{{cannot apply inverse '~Copyable' to type 'each T' in conformance requirement}} |
309 |
| -// expected-note@-3{{generic parameter 'each T' has an implicit Copyable requirement}} |
310 |
| - |
311 |
| -func packItUniquely() { |
312 |
| - packingUniqueHeat_1(MO()) |
313 |
| - // expected-error@-1{{noncopyable type 'MO' cannot be substituted for copyable generic parameter 'each T' in 'packingUniqueHeat_1'}} |
314 |
| - |
315 |
| - packingUniqueHeat_2(MO()) |
316 |
| - // expected-error@-1{{noncopyable type 'MO' cannot be substituted for copyable generic parameter 'each T' in 'packingUniqueHeat_2'}} |
317 |
| - |
318 |
| - packingUniqueHeat_1(10) |
319 |
| -} |
0 commit comments