Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate "export default" in declarations #32057

Closed
intellild opened this issue Jun 24, 2019 · 2 comments
Closed

Duplicate "export default" in declarations #32057

intellild opened this issue Jun 24, 2019 · 2 comments
Assignees
Labels
Bug A bug in TypeScript Domain: Declaration Emit The issue relates to the emission of d.ts files

Comments

@intellild
Copy link

intellild commented Jun 24, 2019

TypeScript Version: 3.5.1 and 3.5.2

Search Terms:
duplicate export default
Code

export function foo() {

}

foo.bar = '';

export default foo;

Expected behavior:

declare function foo(): void;
declare namespace foo {
    var bar: string;
}
export default foo;

Actual behavior:

declare function foo(): void;
declare namespace foo {
    var bar: string;
}
export default foo;
export default foo;

Playground Link:

Related Issues:

@fatcerberus
Copy link

fatcerberus commented Jun 24, 2019

Probably related to #31676. Adding expando properties to exported functions seems to be buggy in general, causing an extra export default to be generated regardless of whether or not one already exists.

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Domain: Declaration Emit The issue relates to the emission of d.ts files labels Jun 24, 2019
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 3.6.0 milestone Jun 24, 2019
@weswigham
Copy link
Member

@DanielRosenwasser this is already fixed in the nightly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Declaration Emit The issue relates to the emission of d.ts files
Projects
None yet
Development

No branches or pull requests

4 participants