You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is minimal settings.
When "declaration": true and "skipDefaultLibCheck": true, this issue is occured.
Expected behavior:
We can compile this code.
Actual behavior:
$ tsc -v
Version 2.0.2
$ tsc -p ./
sampleB.ts(1,5): error TS4023: Exported variable 'v' has or is using name 'Data' from external module "/private/tmp/hogehogehoge/sampleA" but cannot be named.
The text was updated successfully, but these errors were encountered:
at glance root cause of the issue is caching of union types: type of Data in sampleA.ts is string | boolean and it is the same with type of v in sampleB.ts. However type in the first case has associated alias which is not visible if the same type is reused in different context.
Why error does not repro without skipDefaultLibCheck - I guess some declaration in lib.d.ts has the same type. This type will be put in the cache and used for both sampleA.ts and sampleB.ts will
TypeScript Version: 2.0.2
Code
sampleA.ts
sampleB.ts
tsconfig.json
This is minimal settings.
When
"declaration": true
and"skipDefaultLibCheck": true
, this issue is occured.Expected behavior:
We can compile this code.
Actual behavior:
The text was updated successfully, but these errors were encountered: