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

ts7022 reported incorrectly #177595

Closed
ristiisa opened this issue Mar 19, 2023 · 4 comments
Closed

ts7022 reported incorrectly #177595

ristiisa opened this issue Mar 19, 2023 · 4 comments
Assignees
Labels
*not-reproducible Issue cannot be reproduced by VS Code Team member as described typescript Typescript support issues

Comments

@ristiisa
Copy link

ristiisa commented Mar 19, 2023

Type: Bug

ts7022.mp4

It seems that if "problematic line" is included in this typescript code something breaks and the type of result defaults to any and we get this error:

'result' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
const get = (i: string): Promise<string | null> => new Promise(resolve => resolve(i));

(async () => {
  let v: string | null = null;

  if(v == null) v = "";

  while(true) {
    const result = await get(v);

    if(result == null) break;

    if(result === v) break; // problematic line
  }
})();

tsc compiles the code fine without any errors. The project has all the default settings:

npm init
npm i -D typescript
npx tsc --init
npx tsc -v                                                                                                                                               
Version 5.0.2

VS Code version: Code 1.76.2 (ee2b180, 2023-03-14T17:55:54.936Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Sandboxed: No

System Info
Item Value
CPUs AMD Ryzen 9 3900X 12-Core Processor (24 x 3793)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 63.93GB (28.53GB free)
Process Argv --crash-reporter-id f0915d69-058f-4338-abf2-5ba99d197a4d
Screen Reader no
VM 0%
Extensions (14)
Extension Author (truncated) Version
jsoncrack-vscode Ayk 1.0.8
dart-code Dar 3.61.20230307
flutter Dar 3.61.20230301
vscode-eslint dba 2.4.0
LogFileHighlighter emi 2.16.0
dotenv mik 1.0.1
jupyter-keymap ms- 1.1.0
remote-ssh ms- 0.98.0
remote-ssh-edit ms- 0.84.0
remote-wsl ms- 0.76.1
remote-explorer ms- 0.2.0
vscode-versionlens pfl 1.5.0
polacode pnp 0.3.4
vscode-gradle vsc 3.12.6
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
pynewvextcfv2:30681851
azure-dev_surveyonecf:30548226
pyindex848:30662994
nodejswelcome1:30587005
2e4cg342:30602488
pyind779:30671433
89544117:30613380
pythonsymbol12:30671437
6233i204:30672705
vsccsb:30677849
vscodeenable:30660116
defaultazurewalk:30687958
pythonms35:30686772

@IllusionMH
Copy link
Contributor

Looks similar to microsoft/TypeScript#43047 but not sure how check affects type.

@ristiisa
Copy link
Author

Looks similar to microsoft/TypeScript#43047 but not sure how check affects type.

In there the issue is in circularity but in this case no circularity exists.

@mjbvz
Copy link
Contributor

mjbvz commented Mar 20, 2023

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

@mjbvz mjbvz added info-needed Issue requires more information from poster typescript Typescript support issues labels Mar 20, 2023
@ristiisa
Copy link
Author

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

After the yesterdays update the issue is no longer reproducible on the insider build. So the update that came on 18 or 20 must have fixed the issue.

@mjbvz mjbvz added *not-reproducible Issue cannot be reproduced by VS Code Team member as described and removed info-needed Issue requires more information from poster labels Mar 21, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*not-reproducible Issue cannot be reproduced by VS Code Team member as described typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

4 participants