Inconsistent behavior of "export as" symbols.
See original GitHub issueTypeScript Version: 3.4.0-dev.20190305
Search Terms: export alias
Code
This is file of some-lib
:
export { LongNameOfInnerClass as PublicNameClass } from './long-name-of-inner-class';
This is other file, that import above lib:
import { PublicNameClass } from 'some-lib';
new PublicNameClass(); // Here hints is OK
new PublicNameClass(wrongArgument); // Error ref to LongNameOfInnerClass
Expected behavior: TypeScript hints have same “export as” aliases for working code and for errors.
Actual behavior: TypeScript hints for the working code are different from the hints for errors.
Related Issues: Not sure, but it seems that this issue has a similar problem: symbolToName does handle exports of namespaces
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
AIX export symbols incorrect (#19163) - CMake - GitLab
Exporting too many symbols causes problems because a shared library may re-export symbols from another library causing confused dependencies, ...
Read more >Lld-link does not export data symbols - Using Clang
I use the linker to create a DLL, specifying symbols to export on the command line like so: clang++ -fuse-ld=lld -shared -Wl,-export:myfunc ...
Read more >exported and fixing import visibility - Discussion - Swift Forums
Exporting feels more like a build target level configuration to me for a couple of reasons. First, it's a global option for the...
Read more >Dynamic Library Design Guidelines - Apple Developer
... Specifying the Scope and Binding Behavior of Exported Symbols ... But this is also an incompatible revision because the API changed.
Read more >Inconsistent panel border width when exporting as SVG with ...
This might just be because of how devices handle clipping masks. If you want the more consistent behaviour, you can try turning of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Bingo! That shows the behavior as you described! I’d be interested in working on this issue, is that fine @RyanCavanaugh and @KostyaTretyak ?
I’ve started investigating the issue and that specific error is reported from
src/compiler/checker.ts
around line 19560 (file is too long to get a reference link), here:Considering that this would be my first contribution in this repo, I’m trying to understand how it works, so I thought about two approaches:
leftType
here has the original name and not the alias. So if there’s a way to do that, we could check if an export alias exists and show it instead of the original name.leftType
will be already called by its alias.Does this make sense? Any tips what is the best approach?