-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[GSB] Diagnose explicit constraints made redundant by inferred ones. #8281
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
[GSB] Diagnose explicit constraints made redundant by inferred ones. #8281
Conversation
@dabrahams take a look at the second commit |
…ingMutableCollection(wrapping:)
bb0082a
to
2e28311
Compare
@phausler I'd like your opinion on the Foundation commit: is the resulting code clearer or not? @gribozavr You argued against this a while ago, with a crappy prototype of this warning. Now that I've gone through the exercise of doing the warning right and updating the standard library, I think I like it, but didn't want to put it in without giving you a chance to pipe up. |
@swift-ci please smoke test |
I'm going to go ahead and merge based on positive feedback from @dabrahams and my own experience working with this warning. We can back it out if we decide we don't like it. |
The change to measurement makes sense to me, no Measurement can ever be anything but Unit. Furthermore the CoreData change looks good to me as well. |
Very sad about this change. :-( This is definitely the opposite direction from what I'd want. |
Extend the diagnosis of redundant constraints to also include explicitly-specified constraints made redundant by inferred constraints. The canonical example is something like:
where the parameter of type
Set<T>
impliesT: Hashable
. With this PR, we start warning about the explicitT: Hashable
constraint being redundant.