Skip to content

Commit b113d4e

Browse files
committed
[tests] improve the parse-stdlib test
1 parent bf9d524 commit b113d4e

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

test/Sema/copyable_constraint.swift

Lines changed: 0 additions & 14 deletions
This file was deleted.

test/Sema/copyable_parse_stdlib.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
// >> First verify that when building the stdlib, we do have the copyable constraint. Note the module-name!!
3+
// RUN: not %target-swift-frontend -typecheck -parse-stdlib -module-name Swift %s 2>&1 | %FileCheck --check-prefix CHECK-SWIFT-MODULE %s
4+
5+
// Now demonstrate that plain -parse-stdlib, such as in some arbitrary test, doesn't get the Copyable constraint.
6+
// But we also now can't declare a noncopyable type in this mode.
7+
// RUN: not %target-swift-frontend -typecheck -verify -parse-stdlib %s 2>&1 | %FileCheck %s
8+
9+
@_marker public protocol Copyable {}
10+
11+
func nextTime<T>(_ t: T) {}
12+
13+
struct MO : ~Copyable {} // CHECK: cannot suppress implicit conformance to 'Copyable'
14+
15+
nextTime(MO()) // CHECK-SWIFT-MODULE: move-only type 'MO' cannot be used with generics yet

0 commit comments

Comments
 (0)