mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Allow @_noImplicitCopy to be applied to methods. Applying it there means that the self argument will have the attribute.
8 lines
315 B
Swift
8 lines
315 B
Swift
// RUN: %target-typecheck-verify-swift -enable-experimental-move-only
|
|
|
|
struct S {
|
|
func bar(@_noImplicitCopy s: S) {} // okay
|
|
@_noImplicitCopy func foo(s: S) {} // okay
|
|
@_noImplicitCopy mutating func nopers() {} // expected-error {{'@_noImplicitCopy' attribute can only be applied to local lets and params}}
|
|
}
|