Incremental builds ignore missing ambient declarations #36728
Labels
Bug
A bug in TypeScript
Domain: --incremental
The issue relates to incremental compilation
Fix Available
A PR has been opened for this issue
Milestone
TypeScript Version: 3.8.0-dev.20200208
Search Terms: incremental build ambient declarations declare global dts
Code
Steps to reproduce:
tsc
. The project should be built successfully.globals.d.ts
or delete the file itself. (vscode immediately reports the "Cannot find name 'Config'." error inindex.ts
).tsc
again. The build process still completes successfully.tsc --incremental false
. Now it fails correctly.Expected behavior:
The removal of an ambient declaration should be caught by TS when using
--incremental
or--build
and the proper error should be reported.Actual behavior:
When a complete ambient type declaration is removed, related types don't seem to be re-checked.
On the other hand, changing an ambient declaration works as expected.
If, e.g., the
value
constant is removed from the namespace declaration, the proper error is thrown.Please note that this also affects project references'
--build
s.Playground Link:
Not needed.
Related Issues:
Not an issue, but maybe #32849 is related?
Thanks
The text was updated successfully, but these errors were encountered: