Skip to content

Symbols for default exports are not printed correctly #19428

@weswigham

Description

@weswigham

TypeScript Version: 2.6.0-dev.201xxxxx

Code
Initially, this was visible in our type baselines for an internal project, however I have a minimal sample here:

// @declaration: true
// @filename: component.ts
class Foo {}
export default Foo;

// @filename: test.ts
import * as Component from "./component";
export default Component.default;

Expected behavior:

// component.d.ts
declare class Foo {
}
export default Foo;
// test.d.ts
import * as Component from "./component";
declare const _default: typeof Component.default;
export default _default;

Actual behavior:

// component.d.ts
declare class Foo {
}
export default Foo;
// test.d.ts
import * as Component from "./component";
declare const _default: typeof Component.Foo;
export default _default;

Mentioned this to @Andy-MS the other day, since it looks like this behavior appeared awhile ago; I've bisected, and the issue first appears in 71f8852 (so a result of #18616), @Andy-MS care to take a look?

Metadata

Metadata

Assignees

No one assigned

    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

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions