Skip to content

await (await fn()).method() gets wrong type in intellisense #250142

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

Open
greggman opened this issue May 30, 2025 · 0 comments
Open

await (await fn()).method() gets wrong type in intellisense #250142

greggman opened this issue May 30, 2025 · 0 comments
Assignees

Comments

@greggman
Copy link
Contributor

Type: Bug

VSCode's JS intellisense can't handle the expression

const v = await(await fn1()).method2()

Repo

class Banana { }

class BananaTree {
  async requestBanana() {
    return new Banana();
  }
}

async function requestBananaTree() {
  return new BananaTree();
}

const banana1 = await (await requestBananaTree()).requestBanana();

const tree = await requestBananaTree();
const banana2 = await tree.requestBanana();

If you hover over banana2 you'll see it says const banana2: Banana. But if you hover over banana1 it says const banana1: any even though those are equivalent statements in JavaScript itself.

Is that a known issue?

VS Code version: Code 1.100.2 (Universal) (848b80a, 2025-05-14T21:47:40.416Z)
OS version: Darwin arm64 24.5.0
Modes:

System Info
Item Value
CPUs Apple M1 Max (10 x 2400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 7, 9, 7
Memory (System) 64.00GB (8.91GB free)
Process Argv /Users/gman/src/gpuweb/cts --crash-reporter-id daf649d2-2da7-4be7-a143-3be5fa166ded
Screen Reader no
VM 0%
Extensions (26)
Extension Author (truncated) Version
vscode-eslint dba 3.0.10
tintd gfx 0.0.7
copilot-chat Git 0.27.2
go gol 0.46.1
geminicodeassist goo 2.35.0-dogfood.1
cloudcode goo 2.29.0
bikeshed kai 0.0.2
vscode-clang mit 0.2.4
compare-folders mos 0.25.1
vscode-language-pack-ja MS- 1.100.2025051409
csharp ms- 2.76.27
vscode-dotnet-runtime ms- 2.3.5
debugpy ms- 2025.8.0
isort ms- 2025.0.0
python ms- 2025.6.1
vscode-pylance ms- 2025.5.1
remote-ssh ms- 0.120.0
remote-ssh-edit ms- 0.87.0
cpptools ms- 1.25.3
remote-explorer ms- 0.5.0
gnls mse 0.1.4
rewrap stk 1.16.3
code-spell-checker str 4.0.47
vscode-lldb vad 1.11.4
vscode-icons vsc 12.13.0
gitblame wad 11.1.3

(1 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt551cf:31249601
vscod805cf:30301675
binariesv615:30325510
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30959799
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dwnewjupyter:31046869
pythonrstrctxt:31112756
nativeloc2:31192216
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
9064b325:31222308
copilot_t_ci:31222730
e5gg6876:31282496
pythoneinst12:31285622
bgtreat:31268568
4gafe986:31271826
c7cif404:31314491
996jf627:31283433
pythonrdcb7:31303018
usemplatestapi:31297334
0aa6g176:31307128
7bj51361:31289155
747dc170:31275177
pylancecolor:31314202
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003
gendocf:31295004

@greggman greggman changed the title await (await fn).method() gets wrong type in intellisense await (await fn()).method() gets wrong type in intellisense May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants