-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Change error message for default export in namespace #11119
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
Change error message for default export in namespace #11119
Conversation
|
ping @DanielRosenwasser |
src/compiler/checker.ts
Outdated
| 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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs remerge?
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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