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 code is from this post, with just a small change: in scale.ts, the syntax of export list is used export { Scale }.
The compiler returns errors:
scale.ts(5,10): error TS2484: Export declaration conflicts with exported declaration of 'Scale'
advancedScale.ts(9,1): error TS2304: Cannot find name 'Scale'.
consumer.ts(7,7): error TS2339: Property 'weightOnEarth' does not exist on type 'Scale'.
Bug 2
With the original code, in consumer.ts, the line import "./advancedScale"; can be removed but the code still compiles.
The text was updated successfully, but these errors were encountered:
Issue 2, is expected, since you have a tsconfig.json with no "files" or "exclude" list, and that tells the compiler to include all files. so the file is included whether you import it or not.
issue 1 is the real problem here. the work around is to export the declaration and not use an export statement:
TypeScript Version:
1.8.10
Code
Bug 1
This code is from this post, with just a small change: in
scale.ts
, the syntax of export list is usedexport { Scale }
.The compiler returns errors:
Bug 2
With the original code, in
consumer.ts
, the lineimport "./advancedScale";
can be removed but the code still compiles.The text was updated successfully, but these errors were encountered: