Skip to content

[Sema] Allow PlaceholderType Originator to be TypeRepr not just PlaceholderTypeRepr #75463

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

Closed
wants to merge 1 commit into from

Conversation

gregomni
Copy link
Contributor

No functional change. In addition to the Originator change, I realized I failed to move the resolveType() in ConcreteTypeSpecialization back to where it should be in the previous PR so that is included as well.

This is a follow-on to PR #74909.

@gregomni
Copy link
Contributor Author

@swift-ci Please smoke test.

Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

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

I left a comment inline, feel free to land this once addressed.

@@ -1071,12 +1071,12 @@ Type ConstraintSystem::replaceInferableTypesWithTypeVars(
return openUnboundGenericType(unbound->getDecl(), unbound->getParent(),
locator, /*isTypeResolution=*/false);
} else if (auto *placeholderTy = type->getAs<PlaceholderType>()) {
if (auto *placeholderRepr = placeholderTy->getOriginator()
.dyn_cast<PlaceholderTypeRepr *>()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This change needs an additional check for PlaceholderTypeRepr as is we only want to open _ type reprs and not the invalid reprs.

@@ -1172,7 +1172,7 @@ void TypeChecker::notePlaceholderReplacementTypes(Type writtenType,
}

if (auto *origRepr =
placeholder->getOriginator().dyn_cast<PlaceholderTypeRepr *>()) {
placeholder->getOriginator().dyn_cast<TypeRepr *>()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should add an assert here that that makes sure that origRepr was PlaceholderTypeRepr.

@xedin
Copy link
Contributor

xedin commented Jul 26, 2024

Let's hold off on this for a bit because original change is getting reverted due to source compatibility impact.

@xedin
Copy link
Contributor

xedin commented Jul 26, 2024

#75489

@gregomni
Copy link
Contributor Author

Fixed feedback, but won't merge here until/unless the previous stuff works out.

@gregomni
Copy link
Contributor Author

Re-applied in #75526

@gregomni gregomni closed this Jul 27, 2024
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