Skip to content

[5.7][Type Resolution] Resolve (any P.Type).Type as the metatype of an existential metatype. #42391

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

hborla
Copy link
Member

@hborla hborla commented Apr 15, 2022

Cherry-pick of #42380

  • Explanation: Until we model ExistentialMetatypeType as ExistentialType(MetatypeType), type resolution needs to look through the instance type repr when resolving a metatype. Otherwise, there's no way to distinguish between P.Type.Type, which is an existential metatype, and (any P.Type).Type, which is the static metatype of an existential metatype.
  • Scope: The change is scoped to resolving metatypes of existential metatypes during type resolution.
  • Risk: Low.
  • Testing: Added a couple cases to test/type/explicit_existential.swift
  • Reviewer: @CodaFi

Resolves: rdar://91784600

existential metatype.

Until we model ExistentialMetatypeType as ExistentialType(MetatypeType),
type resolution needs to look through the instance type repr when
resolving a metatype. Otherwise, there's no way to distinguish between
P.Type.Type, which is an existential metatype, and (any P.Type).Type,
which is the static metatype of an existential metatype.
@hborla hborla requested a review from a team as a code owner April 15, 2022 17:35
@hborla
Copy link
Member Author

hborla commented Apr 15, 2022

@swift-ci please test

@hborla hborla added the r5.7 label Apr 15, 2022
@hborla hborla merged commit 4400ce4 into swiftlang:release/5.7 Apr 18, 2022
@hborla hborla deleted the 5.7-nested-existential-metatype-resolution branch April 18, 2022 16:05
@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.7 labels Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.7
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants