Fix merging of JS value & TS type decl

Fixes #38383
This commit is contained in:
Eli Barzilay
2020-06-04 16:06:41 -04:00
parent 077a2a9c94
commit 4ee013d1a7
4 changed files with 53 additions and 1 deletions

View File

@@ -7870,7 +7870,7 @@ namespace ts {
(resolvedSymbol || symbol).exports!.forEach((s, name) => {
const exportedMember = members.get(name)!;
if (exportedMember && exportedMember !== s) {
if (s.flags & SymbolFlags.Value) {
if (s.flags & SymbolFlags.Value && exportedMember.flags & SymbolFlags.Value) {
// If the member has an additional value-like declaration, union the types from the two declarations,
// but issue an error if they occurred in two different files. The purpose is to support a JS file with
// a pattern like: