Skip to content

Fixup Extended Existential Metatype Casts #59507

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

Merged
merged 3 commits into from
Jun 17, 2022
Merged

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Jun 16, 2022

The fix here is two-fold:

  1. Teach SILGen that it cannot use the scalar casting paths for extended existentials
  2. Teach the runtime casting entrypoint to unwrap as much parallel metatype structure as possible
    before arriving at a 'Self' type bound for the requirement checking paths.

The code here mirrors the destructuring check we're doing in remote mirrors.

rdar://95166916

The fix here is two-fold:

1) Teach SILGen that it cannot use the scalar casting paths for extended existentials
2) Teach the runtime casting entrypoint to unwrap as much metatype structure as possible
   before arriving at a 'Self' type bound for the requirement checking paths.

The code here mirrors the destructuring check we're doing in remote mirrors.

rdar://95166916
@CodaFi CodaFi requested a review from rjmccall June 16, 2022 20:36
Return a NULL demangle tree instead of crashing. When an unconditional
runtime cast fails, it's going to crash anyways, but this way it prints
a better description (though not great) than the unreachable's message here.
@CodaFi
Copy link
Contributor Author

CodaFi commented Jun 16, 2022

@swift-ci smoke test

@CodaFi
Copy link
Contributor Author

CodaFi commented Jun 16, 2022

@swift-ci smoke test macOS

Ensure the last node after all of the destructuring really
is a dependent generic param type. If it isn't, something has
gone horribly wrong.
Copy link
Contributor

@rjmccall rjmccall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@CodaFi
Copy link
Contributor Author

CodaFi commented Jun 16, 2022

@swift-ci smoke test

@CodaFi
Copy link
Contributor Author

CodaFi commented Jun 17, 2022

@swift-ci smoke test macOS

@CodaFi CodaFi closed this Jun 17, 2022
@CodaFi CodaFi reopened this Jun 17, 2022
@CodaFi
Copy link
Contributor Author

CodaFi commented Jun 17, 2022

@swift-ci smoke test

@CodaFi CodaFi merged commit 541aa8d into swiftlang:main Jun 17, 2022
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