Skip to content

Allow type variables to appear inside opened existential archetypes #76238

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

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Sep 4, 2024

This FIXME comment from #40925 is now fixed:

  // FIXME: Opened archetypes can't be transformed because the
  // the identity of the archetype has to be preserved. This
  // means that simplifying an opened archetype in the constraint
  // system to replace type variables with fixed types is not
  // yet supported. For now, assert that an opened archetype never
  // contains type variables to catch cases where type variables
  // would be applied to the type-checked AST.
  assert(!existential->hasTypeVariable() &&
         "opened existentials containing type variables cannot be simplified");

Fixes rdar://103216428.
Fixes #60547.

@slavapestov slavapestov force-pushed the existential-signature-rework-part-3 branch from 8df553f to 1cc5456 Compare September 4, 2024 04:01
@slavapestov slavapestov changed the title Existential signature rework part 3 Allow type variables to appear inside opened existential archetypes Sep 4, 2024
@slavapestov slavapestov force-pushed the existential-signature-rework-part-3 branch 2 times, most recently from 7eec05f to 09bce44 Compare September 4, 2024 04:07
@slavapestov slavapestov marked this pull request as ready for review September 4, 2024 04:07
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov slavapestov force-pushed the existential-signature-rework-part-3 branch from d21292c to b7af52f Compare September 4, 2024 14:42
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit a3c0e22 into swiftlang:main Sep 4, 2024
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.

Assertion `!type->hasTypeVariable()' with a primary associated type on a protocol
1 participant