-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Convert ObjectLiteralExpr to not use tc.callWitness() or generate a SemanticExpr. #23624
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
Conversation
Hey, I’m sorry I missed this! Do you mind rebasing to fix the merge conflict? |
@swift-ci Please test |
Build failed |
Build failed |
@swift-ci please test |
Build failed |
Build failed |
…emanticExpr. For reference, all other literal types except dictionaries and string interpolation have been converted over to this form.
@swift-ci please test |
Build failed |
Build failed |
I'm able to reproduce the mac failure (or a failure that looks similar), It is this pattern of protocols and classes:
This results in the following substitution map: (note the τ_0_0 that shows up out of nowhere and the inherited_conformance)
What really baffles me is that if I swap everything out for ArrayLiteral (which uses identical conformance lookup logic), I get the following substitution map: (which has no extra type parameter)
This all happens in the CSApply.cpp code and happens in the
|
I don't think we should be building an InheritedProtocolConformance for a class-constrained type parameter like that. Do you want me to take a look? |
Yes, please. |
The problem is that the substitutions stored inside the witness itself are meant for SILGen to use when emitting a witness thunk. They're not always in terms of the generic signature of the type in the conformance. In fact this only happens when the 'synthetic environment' is sufficiently simple, but the two non-trivial cases are when the requirement is generic, or when the witness is in a protocol extension and the conforming type is a class. I think this will break for any literal protocol where a witness is in a protocol extension and the literal type is a class. However, it worked for arrays because of another workaround elsewhere. I have a tentative fix in #25350. |
For reference, all other literal types except dictionaries and string
interpolation have been converted over to this form.