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
[SIL]Record conformances when parsing init_existential_metatype #786
Conversation
Questions for the review:
However, it does seem to be discussed. I'm looking at the sections at line 3257 and line 3387 of SIL.rst. Is this comment out-of-date or am I misunderstanding what is missing? |
For (1), an IRGen test that checks whether the initialized existential metatype is formed with the correct witness table for the conformance should work. |
Looks like you're right about (2) and (3). The verifier can be improved separately, and the TODO looks out of date. |
Awesome. Thank you! I've filed SR 390 about the verifier. |
Okay. Changes since last time:
New questions for this review round:
Thanks again for all of the help! |
For 4 and 5, I defer to @jrose-apple. I'm not sure why |
# Compiles a.swift, b.swift, and c.swift together
swiftc a.swift b.swift c.swift
# Just compiles b.swift, though it can use declarations from a.swift and c.swift
swiftc a.swift -primary-file b.swift c.swift This changes what declarations are considered dead code: if you're compiling everything together, anything that's unused and not public is dead and eliminated before we get to IRGen. You can either mark more things public, or not worry about the extra class and protocol definitions. |
Thank you @jckarter and @jrose-apple for the explanation! I've updated this PR to:
The new changes pass the validation suite cleanly on OS X 10.10 and are ready for inclusion or further feedback. |
Convert a test in order to test the SIL parser and avoid the front end. The updated test verifies that conformances for the init_existential_metatype instruction are calculated correctly. The matching functionality was added in commit 2df6880.
Commit 2df6880 landed code changes equivalent to those in this PR. The newly converted test still adds value though, because it directly exercises the newly added code path and it avoids the frontend. I've reverted the code change, rebased against master, and changed the commit message to match. This updated PR passes cleanly on OS X 10.10 against the new code. |
[SIL]Record conformances when parsing init_existential_metatype
Thanks, looks good! |
This partially resolves bug SR-247.