- Notifications
You must be signed in to change notification settings - Fork664
Description
I have the following two files:
// f.tsdeclareconstx1:A;declareconstx2:A;declareconstx3:A;declareconstx4:A;declareconstx5:A;declareconstx6:A;declareconstx7:A;declareconstx8:A;declareconstx9:A;declareconstx10:A;exportconstf=(k:KeyframeOLD)=>{};// index.tsimport{f}from"./f";f(0);
The filef.ts
has errors of the formCannot find name 'A'.
(TS2304) on all the lines at the beginning, and thenCannot find name 'KeyframeOLD'.
(TS2304) on the last line. So far so good.
A first interesting thing (with Strada) is that if you comment out one of the first lines, then the error on the last line changes toCannot find name 'KeyframeOLD'. Did you mean 'Keyframe'?
(TS2552). I guess this is on purpose? There is probably some logic of the form "if there are too many things that not found, give up on suggesting possible typos".
The issue with Corsa is that we actually get both errors at the same time:
> npx tsgo index.ts[...]f.ts:10:20 - error TS2304: Cannot find name 'A'.10 declare const x10: A; ~f.ts:12:22 - error TS2304: Cannot find name 'KeyframeOLD'.12 export const f = (k: KeyframeOLD) => {}; ~~~~~~~~~~~f.ts:12:22 - error TS2552: Cannot find name 'KeyframeOLD'. Did you mean 'Keyframe'?12 export const f = (k: KeyframeOLD) => {}; ~~~~~~~~~~~Found 12 errors in the same file, starting at: f.ts:1
Strada has only one:
> npx tsc index.ts[...]f.ts:10:20 - error TS2304: Cannot find name 'A'.10 declare const x10: A; ~f.ts:12:22 - error TS2304: Cannot find name 'KeyframeOLD'.12 export const f = (k: KeyframeOLD) => {}; ~~~~~~~~~~~Found 11 errors in the same file, starting at: f.ts:1
I noticed that by running both Corsa and Strada in the middle of a large refactoring to check if we get the same errors, and that was the only difference I noticed so far. Not a very big issue, but still probably a bug to get two very similar errors for the same identifier.