Skip to content

Commit e441d7e

Browse files
committed
[BitwiseCopyable] Only deprecate underscored.
Rather than immediately outright banning the old protocol, just make it be a deprecated typealias for the real one.
1 parent 43c8c2e commit e441d7e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

stdlib/public/core/Misc.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,5 @@ func _rethrowsViaClosure(_ fn: () throws -> ()) rethrows {
180180
@_marker public protocol BitwiseCopyable { }
181181
#endif
182182

183-
@available(*, unavailable)
184-
@_marker public protocol _BitwiseCopyable {}
183+
@available(*, deprecated, message: "Use BitwiseCopyable")
184+
public typealias _BitwiseCopyable = BitwiseCopyable
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: %target-typecheck-verify-swift \
2+
// RUN: -disable-availability-checking \
3+
// RUN: -debug-diagnostic-names
4+
5+
struct S : _BitwiseCopyable {} // expected-warning {{'_BitwiseCopyable' is deprecated: Use BitwiseCopyable}}
6+
7+
func f<T : _BitwiseCopyable>(_ t: T) {} // expected-warning {{'_BitwiseCopyable' is deprecated: Use BitwiseCopyable}}

0 commit comments

Comments
 (0)