Skip to content
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

Improve relationship check for mapped type sources under exactOptionalPropertyTypes #60890

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Andarist
Copy link
Contributor

fixes #60233

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Dec 31, 2024
@@ -12337,7 +12337,24 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}

function getNonMissingTypeOfSymbol(symbol: Symbol) {
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 used by isPropertySymbolTypeRelated, the problem is that - at times - the instantiated mapped symbol is still deferred~ and is an indexed access type. When that happens, this function can't remove the missing type because it's not yet there.

To accommodate that, I clone the indexed access types resulting from that mapped symbol intantiation with a new AccessFlags.NonMissing so when the constraint of that indexed access gets finally requested the missing type can still be removed from it, like this code here intended to.

@Andarist Andarist force-pushed the fix/mapped-types-eopt-constraints branch from 2f33b46 to f62d72a Compare December 31, 2024 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Status: Not started
Development

Successfully merging this pull request may close these issues.

Certain homomorphic mappings break assignability with exactOptionalPropertyTypes
2 participants