microsoft / microsoft/TypeScript
Incorrect errors reported if typeckecking only single file
Aperta
@sheetalkamat ci sta già lavorando.
Dal 20/7/2023.
Needs Investigation
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
Bug Report
🔎 Search Terms
🕗 Version & Regression Information
- This is a crash
- This changed between versions ______ and _______
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
- I was unable to test this on prior versions because _______
⏯ Playground Link
Playground link with relevant code
💻 Code
Dont have reduced repro but here is how to repro:
In Typescript Repo checkout commit at 4879087
Run tsc -b -v src\server
Edit src\server\project.ts to add some comment somewhere (Error is reported only when doing typechecking on this file without typechecking all files in the project)
Run tsc -b -v src\server
// We can quickly address your report if:
// - The code sample is short. Nearly all TypeScript bugs can be demonstrated in 20-30 lines of code!
// - It doesn't use external libraries. These are often issues with the type definitions rather than TypeScript bugs.
// - The incorrectness of the behavior is readily apparent from reading the sample.
// Reports are slower to investigate if:
// - We have to pare too much extraneous code.
// - We have to clone a large repo and validate that the problem isn't elsewhere.
// - The sample is confusing or doesn't clearly demonstrate what's wrong.
🙁 Actual behavior
src/server/project.ts:1668:13 - error TS7023: 'addMissingFileWatcher' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
1668 private addMissingFileWatcher(missingFilePath: Path) {
~~~~~~~~~~~~~~~~~~~~~
src/server/project.ts:1674:15 - error TS7022: 'fileWatcher' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
1674 const fileWatcher = this.projectService.watchFactory.watchFile(
~~~~~~~~~~~
🙂 Expected behavior
No Errors
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Valutazione
Questa issue non è ancora stata valutata.