Skip to content

Conversation

hamishknight
Copy link
Contributor

Avoid producing it in PatternTypeRequest and replacingTypeVariablesAndPlaceholders, and remove some unnecessary hasError and hasUnresolvedType checks.

…laceholders`

Now that ErrorType prints as `_`, we can use that instead of UnresolvedType
here since the original type is only really used for type printing and
debugging.
Return PlaceholderType instead of UnresolvedType, meaning we now
treat the following cases the same:

```
let x1 = foo
let x2: _ = foo
```
These shouldn't be necessary anymore, we should be able to handle
ErrorType patterns.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight
Copy link
Contributor Author

@swift-ci please test source compatibility

// Take a look at the conversion type to check to make sure it is sensible.
if (auto type = contextualInfo.getType()) {
// If we're asked to convert to an UnresolvedType, then ignore the request.
// This happens when CSDiags nukes a type.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is actually the last reference to CSDiag outside of the test suite

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

@hamishknight hamishknight merged commit 8975d1a into swiftlang:main Sep 29, 2025
6 of 7 checks passed
@hamishknight hamishknight deleted the unresolve branch September 29, 2025 17:53
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