-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Tiny associated type inference fixes #28157
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
Tiny associated type inference fixes #28157
Conversation
slavapestov
commented
Nov 8, 2019
- Regression test for https://bugs.swift.org/browse/SR-11392
- Fixes https://bugs.swift.org/browse/SR-11407 / rdar://problem/54979757
@swift-ci Please test |
@swift-ci Please test source compatibility |
@@ -282,6 +282,9 @@ extension _NativeSet { | |||
} | |||
|
|||
extension _NativeSet: _SetBuffer { | |||
@usableFromInline |
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.
This goes away in the next PR.
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.
Thanks!
This forces the interface type, which we don't want to do here.
If a protocol requirement has a type that's a nested member type of another member type, eg, protocol P { associatedtype A : Q func f(_: A.B) } Then we don't actually want to use 'f()' to infer the witness for 'A'. By avoiding doing so, we eliminate some cycles which can allow some programs to type check that didn't before.
…type Previously we did this as a last resort if inference fails. The new behavior is technically source-breaking, but I suspect nobody relied on the old behavior. This can help avoid cycles by eliminating some unnecessary validation work. Fixes <https://bugs.swift.org/browse/SR-11407>, <rdar://problem/54979757>.
71fff5b
to
04fbcc0
Compare
@swift-ci Please test |
@swift-ci Please test source compatibility |