Raised on SO. The following is an error:
export default interface Foo {
}
By design or bug?
It's by design. You can accomplish the exact same effect with
interface Foo {
// stuff
}
export default Foo;
More discussion in #3095.
I'm OK with leaving it as is if the reasoning is that interfaces, et al, are not vaid EcmaScript and #3917 is implemented.
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
Allowing export default + [interface / abstract class / enum / namespace / type ] is tracked by https://github.com/Microsoft/TypeScript/issues/3792
oh i see! thanks. i'll follow on over there.
Most helpful comment
It's by design. You can accomplish the exact same effect with
More discussion in #3095.