Skip to content

Fix a round trip debug type failure with typealias #67051

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
Jul 7, 2023

Conversation

hjyamauchi
Copy link
Contributor

When checking equality of types with existential types removed, recursively remove existential types inside an existential type.

Fixes: #66554

@tristanlabelle
Copy link
Contributor

Should we add the code block from #66554 as a regression test?

@slavapestov
Copy link
Contributor

Yeah, this needs a regression test. Getting IRGen to just emit the mangled type in debuginfo is enough, since we assert if the type doesn't round trip.

But really this whole hack with existential types needs to go away, and ASTDemangler needs to construct ExistentialType in the right places. Do you want to try fixing that instead?

When checking equality of types with existential types removed,
recursively remove existential types inside an existential type.

Fixes: swiftlang#66554
@hjyamauchi
Copy link
Contributor Author

Added a test.

Fixing ASTDemangler may be an interesting project and I'd be interested but I think this fix is good for now.

@tristanlabelle
Copy link
Contributor

@slavapestov It would be great to get the fix in as it is without tackling the refactoring in this PR. Currently we pass in -Xswiftc -disable-round-trip-debug-types as a workaround for this, but it affects some IDE scenarios in VS Code (running tests) where the Swift extension doesn't know to pass this flag.

@slavapestov
Copy link
Contributor

Thanks for adding the test case!

@hjyamauchi
Copy link
Contributor Author

Is it okay to get this fix in?

CC @compnerd

@compnerd
Copy link
Member

compnerd commented Jul 4, 2023

@swift-ci please test

@compnerd compnerd merged commit 145cf9e into swiftlang:main Jul 7, 2023
kphrx added a commit to kphrx/plc-handle-tracker that referenced this pull request Dec 11, 2023
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.

Incorrect reconstructed type crash using typealias+existential+generic protocol+Any?+debug info
4 participants