Skip to content

Commit f46ed6b

Browse files
committed
Put @_moveOnly type attribute behind the move only experimental flag.
Just forgot to do this.
1 parent 0db7246 commit f46ed6b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/Sema/TypeCheckAttr.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,6 +1950,13 @@ void AttributeChecker::visitFinalAttr(FinalAttr *attr) {
19501950
}
19511951

19521952
void AttributeChecker::visitMoveOnlyAttr(MoveOnlyAttr *attr) {
1953+
if (!D->getASTContext().LangOpts.hasFeature(Feature::MoveOnly)) {
1954+
auto error =
1955+
diag::experimental_moveonly_feature_can_only_be_used_when_enabled;
1956+
diagnoseAndRemoveAttr(attr, error);
1957+
return;
1958+
}
1959+
19531960
if (isa<NominalTypeDecl>(D))
19541961
return;
19551962

test/Sema/moveonly_decl_attr.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -parse-stdlib -disable-availability-checking -verify-syntax-tree
1+
// RUN: %target-typecheck-verify-swift -parse-stdlib -disable-availability-checking -verify-syntax-tree -enable-experimental-move-only
22

33
import Swift
44

0 commit comments

Comments
 (0)