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

Fixed substition flow types of NoInfer types #59834

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Sep 3, 2024

fixes #59826

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Sep 3, 2024
Comment on lines 16779 to 16782
if (isNoInferType(type)) {
constraints = append(constraints, (type as SubstitutionType).baseType);
return getNoInferType(getIntersectionType(constraints));
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alternatively, I was thinking about handling the substitution types created here today (with NoInfer base types and non-unknown constraints) in isNoInferType (or at least handling such at the top of inferFromTypes). I concluded this is better and less error-prone though

@typescript-bot typescript-bot added For Backlog Bug PRs that fix a backlog bug and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jan 30, 2025
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.

NoInfer doesn't work in string template types
2 participants