mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SE-390 concluded with choosing the keyword discard rather than forget for the statement that disables the deinit of a noncopyable type. This commit adds parsing support for `discard self` and adds a deprecation warning for `_forget self`. rdar://108859077
13 lines
306 B
Swift
13 lines
306 B
Swift
public extension Regular {
|
|
__consuming func shutdownParty() {
|
|
// FIXME: rdar://108933330 (cannot define struct deinit with -enable-library-evolution)
|
|
// discard self // ok; same module
|
|
}
|
|
}
|
|
|
|
public extension Frozen {
|
|
__consuming func shutdownParty() {
|
|
discard self // ok; same module
|
|
}
|
|
}
|