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

Compiler gives unhelpful error messages in the presence of multiple default exports #3886

Closed
DanielRosenwasser opened this issue Jul 16, 2015 · 2 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue Good First Issue Well scoped, documented and has the green light Help Wanted You can do this

Comments

@DanielRosenwasser
Copy link
Member

export default class foo {

}

export default function bar() {

}

var x = 10;
export default x;

In the above example, the error messages are:

  1. On foo: "Duplicate identifier 'foo'."
  2. On bar: "Duplicate identifier 'bar'."
  3. On export default x: "Duplicate identifier 'default'."

Then we have...

export default function foo() {

}

export default function bar() {

}
  1. On foo: "Duplicate function implementation."
  2. On bar: "Duplicate function implementation."
@DanielRosenwasser DanielRosenwasser added the Bug A bug in TypeScript label Jul 16, 2015
@DanielRosenwasser DanielRosenwasser changed the title Multiple default exports give unhelpful error messages Comiler gives unhelpful error messages in the presence of multiple default exports Jul 27, 2015
@DanielRosenwasser
Copy link
Member Author

#3973 adds tests tests/cases/conformance/es6/modules/multipleDefaultExports01.ts and tests/cases/conformance/es6/modules/multipleDefaultExports02.ts.

@danquirk danquirk changed the title Comiler gives unhelpful error messages in the presence of multiple default exports Compiler gives unhelpful error messages in the presence of multiple default exports Jul 27, 2015
@mhegazy mhegazy added this to the Community milestone Jul 29, 2015
@mhegazy mhegazy added the Help Wanted You can do this label Jul 29, 2015
@DanielRosenwasser DanielRosenwasser added the Good First Issue Well scoped, documented and has the green light label Sep 29, 2015
@DanielRosenwasser
Copy link
Member Author

Thanks @MartyIX!

@DanielRosenwasser DanielRosenwasser added the Fixed A PR has been merged for this issue label Oct 9, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue Good First Issue Well scoped, documented and has the green light Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

2 participants