File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -3398,9 +3398,13 @@ bool ValueDecl::isFinal() const {
3398
3398
}
3399
3399
3400
3400
bool ValueDecl::isMoveOnly () const {
3401
+ // Default answer if a cycle is detected is to say it is noncopyable.
3402
+ // My reasoning is that permitting copying when the user _might_ have intended
3403
+ // for it to be noncopyable is unacceptable as it can lead to silent problems.
3404
+ // At least they'll get unexpected errors if they were expecting to copy!
3401
3405
return evaluateOrDefault (getASTContext ().evaluator ,
3402
3406
IsMoveOnlyRequest{const_cast <ValueDecl *>(this )},
3403
- getAttrs (). hasAttribute <MoveOnlyAttr>() );
3407
+ /* noncopyable= */ true );
3404
3408
}
3405
3409
3406
3410
bool TypeDecl::isSuppressingConformance (KnownProtocolKind kp) const {
You can’t perform that action at this time.
0 commit comments