Files
swift-mirror/test/attr/noimplicitcopy.swift
Nate Chandler cacac0bd83 [SILGen] Allow annotating self @_noImplicitCopy.
Allow @_noImplicitCopy to be applied to methods.  Applying it there
means that the self argument will have the attribute.
2022-09-02 17:32:48 -07:00

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}}
}