Inaccurate Intellisense / Suggestions with Function Overloads #51047
Labels
Domain: Completion Lists
The issue relates to showing completion lists in an editor
Experience Enhancement
Noncontroversial enhancements
Help Wanted
You can do this
Suggestion
An idea for TypeScript
Milestone
Does this issue occur when all extensions are disabled?: Yes
Version: 1.69.1 (system setup)
Commit: b06ae3b2d2dbfe28bca3134cc6be65935cdfea6a
Date: 2022-07-12T08:21:24.514Z
Electron: 18.3.5
Chromium: 100.0.4896.160
Node.js: 16.13.2
V8: 10.0.139.17-electron.0
OS: Windows_NT x64 10.0.19044
Steps to Reproduce:
"c"
on the last line, type, "i"
Apologies, there's probably a better title for this issue...
I thought this might be a better issue for Monaco, but their issue template said that if I could recreate the issue in VS Code to open the issue here. Maybe this should be a TS issue instead since its reproducible in the playground as well? However, the TypeScript seems to be working fine, it's just the intellisense that seems to be confused.
Take the following code:
When spreading arguments into the function corresponding with the second overload, the intellisense provides inaccurate suggestions and incorrectly infers
...keys
as(keyof Foo[])[]
when it should actually be(keyof Foo)[]
:Again, note that TypeScript is working as expected, and accepting any of the suggestions provided by the intellisense will result in a type error.
The text was updated successfully, but these errors were encountered: