Skip to content

[5.1] [Runtime] Fix private generic type witness demangling failure #25637

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

Conversation

beccadax
Copy link
Contributor

Cherry-pick of #25611 to 5.1; original reviewed by @jckarter.

This one’s screwily specific—if you have:

  • a private generic type,
  • with a nested generic type in it,
  • and the nested type conforms to a protocol with an associated type,
  • and that associated type’s witness is a generic type,
  • and some of the witness type’s generic parameters are generic parameters of the nested type,

demangling would fail. The problem is that the substitution machinery in the runtime would consider there to be three, not two, generic context depths involved. Depth 1, which should correspond to the nested type, would instead have no generic parameters. The fix is to skip over depths with zero generic parameters.

Fixes rdar://problem/47773183.

…ang#25611)

This one’s screwily specific--if you have:

* a private generic type,
* with a nested generic type in it,
* and the nested type conforms to a protocol with an associated type,
* and that associated type’s witness is a generic type,
* and some of the witness type’s generic parameters are generic parameters of the nested type,

demangling would fail. The problem is that the substitution machinery in the runtime would consider there to be three, not two, generic context depths involved. Depth 1, which should correspond to the nested type, would instead have no generic parameters. The fix is to skip over depths with zero generic parameters.

Fixes <rdar://problem/47773183>.
@beccadax
Copy link
Contributor Author

@swift-ci please test

There’s only one specific case that isn’t working correctly right now; re-enable the rest of the test. rdar://problem/51959305
@beccadax
Copy link
Contributor Author

beccadax commented Jun 22, 2019

Adding a commit from #25657 to temporarily disable a subtest in certain configurations.

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 6454bcd

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 6454bcd

@beccadax beccadax merged commit c01e5cd into swiftlang:swift-5.1-branch Jun 24, 2019
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