-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Sema: Allow T == NonCopyableOrEscapable
same-type constraints without a redundant T: ~Copyable
.
#81424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sema: Allow T == NonCopyableOrEscapable
same-type constraints without a redundant T: ~Copyable
.
#81424
Conversation
@swift-ci Please test |
@@ -802,15 +803,122 @@ void swift::rewriting::applyInverses( | |||
ASTContext &ctx, | |||
ArrayRef<Type> gps, | |||
ArrayRef<InverseRequirement> inverseList, | |||
ArrayRef<StructuralRequirement> explicitRequirements, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably move this function into its own file because it’s horrible but also self-contained. That’s what I did with ConcreteContraction.cpp
@swift-ci Please test Windows |
21a72bb
to
0be2900
Compare
@swift-ci Please test |
Your change here also moves realizeInheritedRequirements() and StructuralRequirementsRequest::evaluate() to the new file. I was imagining it would just contain the applyInverses() function and nothing else (the circular dependency with RequirementLowering.cpp is fine). |
…ut a redundant `T: ~Copyable`. Enhance the logic in `applyInverses` to also take into account same-type constraints spelled in the generic signature, so that same-type-constraining a type parameter to a type that is itself not `Copyable` or `Escapable` suppresses the default application of those constraints on the type parameter. Fixes rdar://147757973.
0be2900
to
e4a6faa
Compare
Sorry, I grabbed too much in my cut and paste. It should be fixed now. |
@swift-ci Please test |
…nstraint-stop-copyable" This reverts commit 52d7781.
Enhance the logic in
applyInverses
to also take into account same-type constraints spelled in the generic signature, so that same-type-constraining a type parameter to a type that is itself notCopyable
orEscapable
suppresses the default application of those constraints on the type parameter. Fixes rdar://147757973.