Skip to content

Conversation

@a7medev
Copy link
Member

@a7medev a7medev commented Aug 11, 2025

Note

This PR depends on #83646 and it should be set as this PR's base but GitHub doesn't allow this.
Commit 5376af0c67aaacf104b54c42575ed03513fe3b92 is the only change added in this PR.

The swift::ide::eraseArchetypes function is used in code completion to replace archetypes with their upper bound for completion string printing.

Currently, it checks for a provided generic signature before doing anything and returns immediately if no generic signature is provided. This shouldn't be necessary for archetypes though since they carry their generic signature.

This PR enables more helpful code completion results for things like .self and .Type and more generally for types without an explicit generic signature attached.

@a7medev a7medev force-pushed the feat/generalize-erase-archetypes branch from 5376af0 to 4e2cb0b Compare August 16, 2025 22:29
@a7medev a7medev force-pushed the feat/generalize-erase-archetypes branch 2 times, most recently from 7c24e93 to 7d58998 Compare August 26, 2025 19:23
@a7medev
Copy link
Member Author

a7medev commented Aug 26, 2025

@hamishknight BTW I feel like these comments belong to #83646, I understand that GitHub shows everything in this PR due to the lack of a real base branch 🥲. Should we keep the PRs separate or do we join them?

@a7medev a7medev requested a review from hamishknight August 26, 2025 19:33
@hamishknight
Copy link
Contributor

hamishknight commented Aug 26, 2025

Yeah sorry I forgot you had split them, I'll leave follow-up feedback on the other PR. The eraseArchetypes change LGTM 👍

@a7medev a7medev force-pushed the feat/generalize-erase-archetypes branch 2 times, most recently from 26aabc6 to 0357d7d Compare August 26, 2025 21:41
@hamishknight
Copy link
Contributor

@a7medev Can you rebase this now that #83646 has landed?

This generalization enables curried functions with generic parameters coming from the initial declaration to be printed with the archetype's upperbound rather than '_' unresolved type.

As an added benefit, T.self and T.Type for generic parameters now get shown as the upperbound of the generic parameter provided
@a7medev a7medev force-pushed the feat/generalize-erase-archetypes branch from 0357d7d to 491b3a0 Compare August 29, 2025 10:40
@hamishknight
Copy link
Contributor

@swift-ci please test

@hamishknight
Copy link
Contributor

@swift-ci please smoke test macOS

@a7medev
Copy link
Member Author

a7medev commented Aug 31, 2025

@hamishknight I've checked the macOS failure, looks like an issue with swift-docc tests, any idea why that could is happening?

@hamishknight
Copy link
Contributor

Yeah that's unrelated, let's land this

@hamishknight hamishknight merged commit 0c3be92 into swiftlang:main Sep 1, 2025
4 of 5 checks passed
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