Exported variable X has or is using name 'Account' from external module Y but cannot be named #21313
Labels
Bug
A bug in TypeScript
Domain: Declaration Emit
The issue relates to the emission of d.ts files
Fixed
A PR has been merged for this issue
Milestone
TypeScript Version: 2.7.0-dev.20180120
Search Terms: "named", "account", basically the title of this issue
Code
Expected behavior:
This would compile.
Actual behavior:
Additional information:
This only fails when the interface is named "Account". If I rename it to "Account2" or anything else, it works fine. That was the purpose of including the "User" and "Foo" types here. Those can be removed and it still fails. This seems so bizarre, but I've reproduced it in a brand new repository, so it seems real.
Again, if I import directly from the file it works fine, but the other two types work fine without that:
I was so excited to get my hands on the RC and start removing all these extra imports, and that's how I hit this because we have a class named
Account
and the problem was not fixed for it (see related issues).Playground Link:
I wasn't sure how or if I could recreate this in the playground. Seems limited.
Related Issues:
This is the exact same as my previous issue, #20657, except that it now fails only for the word
Account
(as far as I've found). @weswigham fixed that one in #20661, and nothing looked out of the ordinary.So this is related to the same issues that that issue is related to: #5938, #8612, #19825
There is still another open issue with the same error message: #9944. I'm unclear what the difference is on that one, but it's pretty old. Seems to be maybe more about inferred types? Here we are only dealing with explicit types.
The text was updated successfully, but these errors were encountered: