Skip to content

Conversation

@slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Mar 25, 2025

This fixes a regression from f6e7c16. The mapTypeIntoContext() call in visitFullApplySite() was not necessary because the type in question is already fully substituted and should no longer contain type parameters.

However, it can contain archetypes, which is what caused mapTypeIntoContext() to assert. Indeed, this case where the return type is generic but still loadable wasn't covered by our test suite.

(I believe the other places where mapTypeIntoContext() was introduced in that commit are correct, because there we're dealing with the interface type of the current function, which can contain type parameters.)

The mapTypeIntoContext() call in visitFullApplySite() was not
necessary.

The type in question is already fully substituted and should
no longer contain type parameters.

However, it can contain archetypes, which is what caused
mapTypeIntoContext() to assert.

Indeed, this case where the return type is generic but still
loadable wasn't covered by our test suite.

- Fixes swiftlang#80020.
- Fixes rdar://147051717.
@slavapestov slavapestov requested a review from rjmccall as a code owner March 25, 2025 16:35
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

CC @drexin

@slavapestov slavapestov enabled auto-merge March 25, 2025 16:39
Copy link
Contributor

@drexin drexin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@slavapestov slavapestov merged commit d23adf4 into swiftlang:main Mar 25, 2025
3 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.

6.1 nightly crashes on "Assertion `!type.hasPrimaryArchetype()' failed" with typed throws

2 participants