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

Typescript export default erased in presence of namespace #10033

Closed
Wolvereness opened this issue May 28, 2019 · 1 comment · Fixed by #10034
Closed

Typescript export default erased in presence of namespace #10033

Wolvereness opened this issue May 28, 2019 · 1 comment · Fixed by #10034
Labels
i: bug i: needs triage outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@Wolvereness
Copy link
Contributor

Wolvereness commented May 28, 2019

Bug Report

Current Behavior

The presence of a declare namespace where the name is shared erases the export default.

export class N {
  f1(value) {
    value.f2();
  }

}

Input Code

export class N {
    f1(value: N.I) {
        value.f2();
    }
}
export declare namespace N {
    export interface I {
        f2();
    }
}
export default N;

Expected behavior/code

export class N {
  f1(value) {
    value.f2();
  }

}

export default N;

Babel Configuration (.babelrc, package.json, cli command)

{
  "your": { "config": "here" }
}

Environment

  • Babel version(s): a596da2
  • Node/npm version: v8.12.0
  • OS: Windows 10
  • Monorepo: ?
  • How you are using Babel: cli fixtures

Possible Solution

Same solution.

Independently: #10034

Required for: #9785

Additional context/Screenshots

Introduced in #10019

@babel-bot
Copy link
Collaborator

Hey @Wolvereness! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community
that typically always has someone willing to help. You can sign-up here
for an invite.

Wolvereness added a commit to VelocityMSC/babel that referenced this issue May 28, 2019
Wolvereness added a commit to VelocityMSC/babel that referenced this issue May 28, 2019
Wolvereness added a commit to VelocityMSC/babel that referenced this issue May 28, 2019
This also fixes enum not adding the respective declaration to the scope
during the typescript visitation.

Rewrites:

2080042 babel#9944

a6392bd babel#10019
nicolo-ribaudo pushed a commit that referenced this issue May 29, 2019
This also fixes enum not adding the respective declaration to the scope
during the typescript visitation.

Rewrites:

2080042 #9944

a6392bd #10019
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Aug 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: bug i: needs triage outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants