Skip to content

Commit 38d84ff

Browse files
authored
Merge pull request #40346 from DougGregor/sendable-incremental-adoption
2 parents 7871205 + 7e375f7 commit 38d84ff

13 files changed

+235
-221
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4601,9 +4601,9 @@ WARNING(non_sendable_keypath_access,none,
46014601
"cannot form key path that accesses non-sendable type %0",
46024602
(Type))
46034603
ERROR(non_concurrent_type_member,none,
4604-
"%select{stored property %1|associated value %1}0 of "
4605-
"'Sendable'-conforming %2 %3 has non-sendable type %4",
4606-
(bool, DeclName, DescriptiveDeclKind, DeclName, Type))
4604+
"%select{stored property %2|associated value %2}1 of "
4605+
"'Sendable'-conforming %3 %4 has non-sendable type %0",
4606+
(Type, bool, DeclName, DescriptiveDeclKind, DeclName))
46074607
ERROR(concurrent_value_class_mutable_property,none,
46084608
"stored property %0 of 'Sendable'-conforming %1 %2 is mutable",
46094609
(DeclName, DescriptiveDeclKind, DeclName))

lib/Sema/TypeCheckAvailability.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3526,9 +3526,9 @@ void swift::diagnoseTypeAvailability(const TypeRepr *TR, Type T, SourceLoc loc,
35263526
}
35273527

35283528
static void diagnoseMissingConformance(
3529-
SourceLoc loc, Type type, ProtocolDecl *proto, ModuleDecl *module) {
3529+
SourceLoc loc, Type type, ProtocolDecl *proto, const DeclContext *fromDC) {
35303530
assert(proto->isSpecificProtocol(KnownProtocolKind::Sendable));
3531-
diagnoseMissingSendableConformance(loc, type, module);
3531+
diagnoseMissingSendableConformance(loc, type, fromDC);
35323532
}
35333533

35343534
bool
@@ -3546,16 +3546,14 @@ swift::diagnoseConformanceAvailability(SourceLoc loc,
35463546

35473547
// Diagnose "missing" conformances where we needed a conformance but
35483548
// didn't have one.
3549+
auto *DC = where.getDeclContext();
35493550
if (auto builtinConformance = dyn_cast<BuiltinProtocolConformance>(rootConf)){
35503551
if (builtinConformance->isMissing()) {
35513552
diagnoseMissingConformance(loc, builtinConformance->getType(),
3552-
builtinConformance->getProtocol(),
3553-
where.getDeclContext()->getParentModule());
3553+
builtinConformance->getProtocol(), DC);
35543554
}
35553555
}
35563556

3557-
auto *DC = where.getDeclContext();
3558-
35593557
auto maybeEmitAssociatedTypeNote = [&]() {
35603558
if (!depTy && !replacementTy)
35613559
return;

0 commit comments

Comments
 (0)