Skip to content
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-verifier] Verify correctly that lowered SIL optional types are lowered types of formal optional types. #5249

Merged
merged 2 commits into from Oct 12, 2016

Conversation

gottesmm
Copy link
Member

Recently, the lowering of Optional was changed to be more like the lowering
of tuples. Specifically this means that we recursively propagate types into the
optional's component type rather than treating the component type as a
standalone formal type ala other nominal types.

This patch updates the function isLoweringOf in the SILVerifier that was missed
as apart of the aforementioned updates. Specifically, previously isLoweringOf
assumed that the optional's component type was always a formal type implying
that it could just compare the lowered SIL types corresponding formal type and
the passed in formal type. Now since we are propagating types down into the
optional's component types, we need to recurse performing isLoweringOf on the
maximally abstracted version of the optional SIL type (i.e. the primitive
address form).

I would like to thank John for his patience in explaining the big picture here.

rdar://28536812

…ation, print it when dumping.

This makes it easy when debugging to tell the difference in between metatypes
with differing representations.

rdar://28536812
…owered types of formal optional types.

Recently, the lowering of Optional<T> was changed to be more like the lowering
of tuples. Specifically this means that we recursively propagate types into the
optional's component type rather than treating the component type as a
standalone formal type ala other nominal types.

This patch updates the function isLoweringOf in the SILVerifier that was missed
as apart of the aforementioned updates. Specifically, previously isLoweringOf
assumed that the optional's component type was always a formal type implying
that it could just compare the lowered SIL types corresponding formal type and
the passed in formal type. Now since we are propagating types down into the
optional's component types, we need to recurse performing isLoweringOf on the
maximally abstracted version of the optional SIL type (i.e. the primitive
address form).

I would like to thank John for his patience in explaining the big picture here.

rdar://28536812
@gottesmm
Copy link
Member Author

@swift-ci Please smoke test and merge

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.

None yet

3 participants