TypeScript/tests/cases/compiler/destructuredDeclarationEmit.ts
Wesley Wigham 50866e114a
Fix visibility checking of mutually recursive exports (#19929)
* Do visibility painting from collectLinkedAliases in checker to remove statefullness in declaration emit

* Fix #17085

* Add deeply destructured array to test

* Add test case for #18634

* Add PR feedback
2017-11-21 15:06:27 -08:00

22 lines
637 B
TypeScript

// @declaration: true
// @filename: foo.ts
const foo = { bar: 'hello', bat: 'world', bam: { bork: { bar: 'a', baz: 'b' } } };
const arr: [0, 1, 2, ['a', 'b', 'c', [{def: 'def'}, {sec: 'sec'}]]] = [0, 1, 2, ['a', 'b', 'c', [{def: 'def'}, {sec: 'sec'}]]];
export { foo, arr };
// @filename: index.ts
import { foo, arr } from './foo';
export { foo, arr };
const { bar: baz, bat, bam: { bork: { bar: ibar, baz: ibaz } } } = foo;
export { baz, ibaz };
const [ , one, , [, bee, , [, {sec} ]]] = arr;
export { one, bee, sec };
const getFoo = () => ({
foo: 'foo'
});
const { foo: foo2 } = getFoo();
export { foo2 };