Skip to content

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
@ethanresnick
Copy link
Contributor

@Andarist Would this also fix the case I mentioned here?

@Andarist
Copy link
Contributor Author

I don't think so, see #60233 (comment)

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

3 participants