-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Improve string literal completions for property values when a partially-typed string fixes inference to a type parameter #51770
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
// @Filename: /a.tsx | ||
//// declare function bar1<P extends "" | "bar" | "baz">(p: { type: P }): void; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. notice how this test is almost identical to the one here: the only difference is that the argument here is |
||
//// | ||
//// bar1({ type: "/*ts*/" }) | ||
//// | ||
|
||
verify.completions({ marker: ["ts"], exact: ["", "bar", "baz"] }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The added test case only relies on this one. However, I've passed around
contextFlags
to all otherchecker.getContextualType
calls in this function for consistency