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

ts type judgment incorrectly crosses the boundaries of the asynchronous task #60824

Closed
sun-jingfeng opened this issue Dec 18, 2024 · 2 comments
Closed
Labels
Duplicate An existing issue was already created

Comments

@sun-jingfeng
Copy link

sun-jingfeng commented Dec 18, 2024

Does this issue occur when all extensions are disabled?: No

1.Version information:
Version: 1.96.0 (Universal)
Commit: 138f619c86f1199955d53b4166bef66ef252935c
Date: 2024-12-11T02:29:09.626Z
Electron: 32.2.6
ElectronBuildId: 10629634
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Darwin arm64 23.4.0

2.The bug recurrence code is as follows:

let globalStr: string | null = 'abc'
const asyncFun = async () => {
  if (globalStr) {
    console.log(globalStr)
    await new Promise(res => setTimeout(res, 3000))
    console.log(globalStr) // Is globalStr of type string wrong?
  }
}
asyncFun()
globalStr = null
@sun-jingfeng sun-jingfeng changed the title ts类型判断错误地跨域了异步任务的边界 ts type judgment incorrectly crosses the boundaries of the asynchronous task Dec 19, 2024
@mjbvz mjbvz transferred this issue from microsoft/vscode Dec 19, 2024
@mjbvz mjbvz removed their assignment Dec 19, 2024
@MartinJohns
Copy link
Contributor

Duplicate of #9998.

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Jan 2, 2025
@typescript-bot
Copy link
Collaborator

This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@typescript-bot typescript-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

5 participants