Skip to content

Commit 29fb2a6

Browse files
authored
Merge pull request #73112 from kavon/6.0-reverse-condfail-ncg-assoc
[6.0] fix reverse cond-fail for SuppressedAssociatedTypes
2 parents 5f41b76 + ed75561 commit 29fb2a6

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

lib/AST/RequirementMachine/RequirementLowering.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,11 @@ void swift::rewriting::applyInverses(
757757

758758
// Inverses on associated types are experimental.
759759
if (!allowInverseOnAssocType && canSubject->is<DependentMemberType>()) {
760-
errors.push_back(RequirementError::forInvalidInverseSubject(inverse));
761-
continue;
760+
// Special exception: allow if we're building the stdlib.
761+
if (!ctx.MainModule->isStdlibModule()) {
762+
errors.push_back(RequirementError::forInvalidInverseSubject(inverse));
763+
continue;
764+
}
762765
}
763766

764767
// Noncopyable checking support for parameter packs is not implemented yet.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// RUN: %target-typecheck-verify-swift -parse-stdlib -module-name Swift -enable-experimental-feature NoncopyableGenerics
2+
3+
public protocol Hello {
4+
associatedtype Req: ~Copyable
5+
}

0 commit comments

Comments
 (0)