Skip to content

[SR-13466]: Fix demangling of optionals containing function types. #37814

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 1 commit into from
Jun 8, 2021

Conversation

al45tair
Copy link
Contributor

@al45tair al45tair commented Jun 7, 2021

ImplFunctionType nodes inside optionals are wrapped in Type nodes,
which means that isSimpleType() needs to look through the Type node
when we're printing them, or we fail to wrap them with parentheses.

  • Scope: Addresses a bug in swift demangle that resulted in incorrect output.
  • Risk: Low. It only affects swift demangle output, and only in cases where the existing output was incorrect.
  • Origination: Looks like an oversight in the code that tested whether parentheses were necessary. There was only one pre-existing test case in the demangler tests that had incorrect output, and since the output has to be fairly complex before this bug is triggered, it's perhaps understandable that whoever added it didn't spot the mistake.
  • Resolves: rdar://67915116

@al45tair al45tair requested a review from a team as a code owner June 7, 2021 09:08
ImplFunctionType nodes inside optionals are wrapped in Type nodes,
which means that isSimpleType() needs to look through the Type node
when we're printing them, or we fail to wrap them with parentheses.

<rdar://67915116>
@al45tair
Copy link
Contributor Author

al45tair commented Jun 7, 2021

@swift-ci Please smoke test

@al45tair
Copy link
Contributor Author

al45tair commented Jun 7, 2021

@swift-ci Please test

@al45tair
Copy link
Contributor Author

al45tair commented Jun 7, 2021

@swift-ci please nominate

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.

4 participants