-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Generic object literal completions include any random member you’re currently typing #35268
Copy link
Copy link
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
TypeScript Version: 3.8.0-dev.20191121
Search Terms:
- suggest / suggestions / completions / intellisense
- optional
- extends
Code
For the code:
interface Test {
keyPath?: string;
autoIncrement?: boolean;
}
function test<T extends Record<string, Test>>(opt: T) { }
test({
a: {
keyPath: '',
a
}
})Trigger suggestions after a in the call to test.
Expected behavior:
Suggestion for autoIncrement returned.
Actual behavior:
No suggestion for autoIncrement. Only a single suggestion for a is returned
[Trace - 18:58:01.966] <semantic> Sending request: completionEntryDetails (90). Response expected: yes. Current queue length: 0
Arguments: {
"file": "/Users/matb/projects/san/a.ts",
"line": 11,
"offset": 10,
"entryNames": [
"a"
]
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue