Skip to content

Conversation

@hborla
Copy link
Member

@hborla hborla commented Mar 17, 2022

#40269 is a source breaking change, as noted here:

protocol P { associatedtype A = Int }
protocol Q { associatedtype B }
protocol R: P, Q where A == B {}

struct S: R {}

This code compiles today, but breaks with the associated type inference refactoring. Unfortunately, there's real-world code relying on the old behavior.

Resolves: rdar://90402522

@hborla
Copy link
Member Author

hborla commented Mar 17, 2022

@AnthonyLatsis do you think it'd be relatively straightforward to put the new behavior behind a flag? I'm not too familiar with your change, but with your help, I'll happily attempt to put it behind a flag instead of the revert.

@hborla hborla requested a review from AnthonyLatsis March 17, 2022 23:46
@AnthonyLatsis
Copy link
Collaborator

AnthonyLatsis commented Mar 18, 2022

Bummer! Let us see... We would need to revert this to resurrect the old code and conditionalise the inference method in AssociatedTypeInference::inferAbstractTypeWitnesses with respect to these changes (disregard all the const additions). Sounds relatively straightforward from what I see. The backup plan would be to trade duplication for easiness and define a second inferAbstractTypeWitnesses. Everything else should be good to keep.


Let me know if you need any help!

@AnthonyLatsis
Copy link
Collaborator

AnthonyLatsis commented Mar 23, 2022

@hborla In case you haven't started working on the flag yet — just want to be honest and let you know that I don't feel right about having you fix a problem that I'm responsible for unless you are actually interested, and would be glad to resolve this if given the opportunity. 🙂

@hborla
Copy link
Member Author

hborla commented Mar 23, 2022

@AnthonyLatsis I have not started working on the flag yet! I was working on a couple other PRs that I wanted to get up before doing that, but if you'd like to add the flag instead, please go for it 🙂

@AnthonyLatsis
Copy link
Collaborator

#42004

@hborla
Copy link
Member Author

hborla commented Mar 24, 2022

@AnthonyLatsis Thank you! Closing this in favor of your PR 🙏🏻

@hborla hborla closed this Mar 24, 2022
@hborla hborla deleted the associatedtype-inference-revert branch June 28, 2022 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants