Files
swift-mirror/test/expr/print/discard.swift
Kavon Farvardin 3e4bc82aa8 rename _forget to discard; deprecate _forget
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
2023-05-08 21:42:19 -07:00

16 lines
277 B
Swift

// RUN: %target-swift-frontend -print-ast %s 2>&1 | %FileCheck %s
@_moveOnly
struct S {
__consuming func c() {
discard self
}
deinit {}
}
// CHECK: @_moveOnly internal struct S {
// CHECK: internal __consuming func c() {
// CHECK: discard self
// CHECK: }