Skip to content

When generating definitions re-exporting variables destructured from functions has missing types #18634

@luke-john

Description

@luke-john

TypeScript Version:

2.4.2 / 2.5.2

Code

const getFoo = () => ({
    foo: 'foo'
})

// broken: foo is missing in definitions
const { foo } = getFoo()
export { foo }

// workaround: foo is in definitions
export const { foo } = getFoo()

Expected behavior:

foo should exist in the generated definitions when destructured from a function and then exported separately.

Actual behavior:

foo is missing from the generated definitions when destructured from a function and then exported separately.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesFixedA PR has been merged for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions