Change error message for default export in namespace#11119
Conversation
|
ping @DanielRosenwasser |
| else if (source.symbol && source.flags & TypeFlags.ObjectType && globalObjectType === source) { | ||
| reportError(Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead); | ||
| } | ||
| else if (source.symbol && source.flags & TypeFlags.ObjectType && globalObjectType === source) { |
| export = A; | ||
| ~~~~~~~~~~~ | ||
| !!! error TS1063: An export assignment cannot be used in a namespace. | ||
| !!! error TS1063: A default export can only be used in an ECMAScript-style module. |
There was a problem hiding this comment.
This is a regression - the old error is actually more appropriate here.
|
@YuichiNukiyama would you still be interested in fixing up the bug? I think all you'd need to do is still issue the old error message for |
|
@DanielRosenwasser Sorry for the delay. How is this? |
|
Looks good! However, it looks like you've added a test from one of your older PRs ( |
|
@YuichiNukiyama |
|
|
This reverts commit b293257.
|
@DanielRosenwasser fix it. |
Fixes #11092