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

Export default on interface not allowed #3194

Closed
basarat opened this issue May 18, 2015 · 5 comments
Closed

Export default on interface not allowed #3194

basarat opened this issue May 18, 2015 · 5 comments
Labels
By Design Deprecated - use "Working as Intended" or "Design Limitation" instead

Comments

@basarat
Copy link
Contributor

basarat commented May 18, 2015

Raised on SO. The following is an error:

export default interface Foo {
}

By design or bug?

@ahejlsberg
Copy link
Member

It's by design. You can accomplish the exact same effect with

interface Foo {
    // stuff
}
export default Foo;

More discussion in #3095.

@ahejlsberg ahejlsberg added the By Design Deprecated - use "Working as Intended" or "Design Limitation" instead label May 18, 2015
@mhegazy mhegazy closed this as completed May 18, 2015
@clavecoder
Copy link

I'm OK with leaving it as is if the reasoning is that interfaces, et al, are not vaid EcmaScript and #3917 is implemented.

@cdaringe
Copy link

hi all,

i unexpectedly encountered this too.

@ahejlsberg, can you clarify on your remarks further? the discussion in #3095 seems to be focusing more on the declaration collisions, which is all said and good.

@clavecoder, i don't fully see the rationale you point to. Interfaces aren't valid ecmascript either, so why shed convention?

these remarks are (of course) stated in a cordial tone. however, this decision feels very counterintuitive to me

@mhegazy
Copy link
Contributor

mhegazy commented Nov 22, 2016

Allowing export default + [interface / abstract class / enum / namespace / type ] is tracked by #3792

@cdaringe
Copy link

oh i see! thanks. i'll follow on over there.

@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
By Design Deprecated - use "Working as Intended" or "Design Limitation" instead
Projects
None yet
Development

No branches or pull requests

5 participants