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

Disallow merging for default export declarations #3973

Merged
merged 23 commits into from
Jul 27, 2015

Conversation

DanielRosenwasser
Copy link
Member

Fixes #3095.

With this change, the following code will now cause an error:

export default function Foo() {
}

export namespace Foo {
    export var x = 10;
}

The idea is that the namespace cannot overlap in the same space with the function because the two do not agree in their modifiers.

However, the following will continue to work

export default function Foo() {
}

export interface Foo {
    export var x = 10;
}

This will give the module a function for a default export, and an exported interface Foo. The two will not be merged.

@DanielRosenwasser DanielRosenwasser added Breaking Change Would introduce errors in existing code and removed Breaking Change Would introduce errors in existing code labels Jul 22, 2015
forEach(symbol.declarations, d => {
let exportedDeclarationSpaces = SymbolFlags.None;
let nonExportedDeclarationSpaces = SymbolFlags.None;
let defaultExportedDeclarationFlags = SymbolFlags.None;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should end with the word "spaces" not "flags".

@JsonFreeman
Copy link
Contributor

👍

DanielRosenwasser added a commit that referenced this pull request Jul 27, 2015
Disallow merging for default export declarations
@DanielRosenwasser DanielRosenwasser merged commit 4f507a6 into master Jul 27, 2015
@DanielRosenwasser DanielRosenwasser deleted the disallowDefaultExportDeclMerging branch July 27, 2015 19:03
@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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants