Microsoft/TypeScript

Inconsistent behavior of "export as" symbols.

Open

#30.223 aperta il 5 mar 2019

Vedi su GitHub
 (6 commenti) (0 reazioni) (0 assegnatari)TypeScript (6726 fork)batch import
BugDomain: Error MessagesHelp Wanted

Metriche repository

Star
 (48.455 star)
Metriche merge PR
 (Merge medio 6g 17h) (9 PR mergiate in 30 g)

Descrizione

TypeScript 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

Guida contributor