mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
describe more cases of noncopyable in a tuple; also improve existing message a bit.
This commit is contained in:
@@ -6156,6 +6156,13 @@ bool NotCopyableFailure::diagnoseAsError() {
|
||||
|
||||
case NoncopyableMatchFailure::CopyableConstraint: {
|
||||
auto *loc = getLocator();
|
||||
|
||||
if (loc->isLastElement<LocatorPathElt::AnyTupleElement>()) {
|
||||
assert(!noncopyableTy->is<TupleType>() && "will use poor wording");
|
||||
emitDiagnostic(diag::tuple_move_only_not_supported, noncopyableTy);
|
||||
return true;
|
||||
}
|
||||
|
||||
// a bit paranoid of nulls and such...
|
||||
if (auto *genericParam = loc->getGenericParameter()) {
|
||||
if (auto *paramDecl = genericParam->getDecl()) {
|
||||
|
||||
Reference in New Issue
Block a user