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

[SR-13466] swift demangle prints Optionals with the wrong precedence. #55908

Closed
typesanitizer opened this issue Aug 28, 2020 · 2 comments
Closed
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@typesanitizer
Copy link

Previous ID SR-13466
Radar rdar://problem/67915116
Original Reporter @typesanitizer
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee @al45tair
Priority Medium

md5: 3f2004d0c4b203eaf11909ccaf1a3b36

Issue Description:

If you run

swift demangle --expand sSvSgA3ASbIetCyyd_SgSbIetCyyyd_SgD

The output shows that the correct type is

Optional<@convention(c) (Optional<UnsafeMutableRawPointer>, Optional<UnsafeMutableRawPointer>, Optional<@convention(c) (Optional<UnsafeMutableRawPointer>, Optional<UnsafeMutableRawPointer>) -> Bool>) -> Bool>

but it is printed as

@escaping @convention(thin) @convention(c) (@unowned Swift.UnsafeMutableRawPointer?, @unowned Swift.UnsafeMutableRawPointer?, @unowned @escaping @convention(thin) @convention(c) (@unowned Swift.UnsafeMutableRawPointer?, @unowned Swift.UnsafeMutableRawPointer?) -> (@unowned Swift.Bool)?) -> (@unowned Swift.Bool)?

This has the wrong precedence. ? binds more tightly than ->.

@typesanitizer
Copy link
Author

@swift-ci create

@al45tair
Copy link
Contributor

al45tair commented Jun 7, 2021

This is fixed in #37787

(Cherry picked to release/5.5 in #37814

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

2 participants