Skip to content

Properly determine whether an augmentation is a ValueModule or NamespaceModule#12672

Merged
4 commits merged into
masterfrom
import_star_namespace
Jan 25, 2017
Merged

Properly determine whether an augmentation is a ValueModule or NamespaceModule#12672
4 commits merged into
masterfrom
import_star_namespace

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Dec 5, 2016

Fixes #12030

We already correctly allow to augment export = with type declarations.
But we had incorrectly allowed augmenting with a value module, which doesn't work if you try to import
This may break some types; I'll test on DefinitelyTyped with this.

The reason this works without touching the checker is that mergeModuleAugmentation calls mergeSymbol, which already contains code to check for bad merges.

@sandersn
Copy link
Copy Markdown
Member

sandersn commented Dec 5, 2016

Code looks good to me, but you should have @mhegazy or @vladima sign off on the change in semantics. I think this change is an improvement but I'm not sure.

==== /node_modules/lib/index.d.ts (2 errors) ====
declare var lib: () => void;
~~~
!!! error TS2300: Duplicate identifier '"lib"'.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this error message will look odd if this name won't be lib

@ghost ghost merged commit b9a18fd into master Jan 25, 2017
@ghost ghost deleted the import_star_namespace branch January 25, 2017 15:21
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
This pull request was closed.
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.

4 participants