mirror of
https://github.com/apple/swift.git
synced 2026-10-18 17:49:23 +02:00
Some diagnostics need to refer to values or types in relation to whether they conform to Swift's three invertible protocols (`Copyable`, `Escapable`, and `Deinitable`). Many diagnostics were not using consistent terminology to do so, and this change brings them into alignment. There are many possible styles we could converge on: noncopyable, non-copyable, non-Copyable, non-'Copyable', or ~Copyable. Out of these, I think the leading candidates are noncopyable and non-'Copyable'. The former is a more terse term of art that is already used widely in the Swift book and proposals, whereas the latter is more verbose but consistent with typical compiler diagnostics that make a references to specific declarations (the built-in `Copyable` protocol in these examples). Reword diagnostics to use the "non-'Copyable'" spelling because it refers to the protocol by name, the same way other diagnostics refer to declarations.
12 lines
544 B
Swift
12 lines
544 B
Swift
// RUN: %target-swift-frontend -O -sil-verify-all -verify -emit-sil -enable-library-evolution %s
|
|
|
|
// rdar://173376043 (Improve diagnostics for Compiler crash: ~Copyable protocol extension with public settable property + library evolution)
|
|
public protocol NonCopyableWithVar: ~Copyable {}
|
|
extension NonCopyableWithVar where Self: ~Copyable {
|
|
public var value: Int32 {
|
|
get { 0 } // expected-error{{copy of non-'Copyable' typed value. This is a compiler bug. Please file a bug with a small example of the bug}}
|
|
set {}
|
|
}
|
|
}
|
|
|