fix(compiler): generate the correct imports for summary type-check

Summaries should be ignored when importing the types used in a
type-check block.
This commit is contained in:
Chuck Jazdzewski
2017-12-11 08:50:46 -08:00
committed by Alex Rickabaugh
parent d213a20dfc
commit d91ff17adc
5 changed files with 64 additions and 39 deletions

View File

@ -196,6 +196,25 @@ describe('StaticSymbolResolver', () => {
.toBe(symbolCache.get('/test3.d.ts', 'b'));
});
it('should ignore summaries for inputAs if requested', () => {
init(
{
'/test.ts': `
export {a} from './test2';
`
},
[], [{
symbol: symbolCache.get('/test2.d.ts', 'a'),
importAs: symbolCache.get('/test3.d.ts', 'b')
}]);
symbolResolver.getSymbolsOf('/test.ts');
expect(
symbolResolver.getImportAs(symbolCache.get('/test2.d.ts', 'a'), /* useSummaries */ false))
.toBeUndefined();
});
it('should calculate importAs for symbols with members based on importAs for symbols without',
() => {
init(