mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
fix module record nonambiguous case, add test for it
This commit is contained in:
@@ -1113,7 +1113,7 @@ namespace ts {
|
||||
};
|
||||
}
|
||||
}
|
||||
else if (lookupTable && exportNode && id !== "default" && hasProperty(target, id)) {
|
||||
else if (lookupTable && exportNode && id !== "default" && hasProperty(target, id) && target[id] !== source[id]) {
|
||||
lookupTable[id].exportsWithDuplicate.push(exportNode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
//// [tests/cases/compiler/moduleSameValueDuplicateExportedBindings.ts] ////
|
||||
|
||||
//// [a.ts]
|
||||
export * from "./b";
|
||||
export * from "./c";
|
||||
|
||||
//// [b.ts]
|
||||
export * from "./c";
|
||||
|
||||
//// [c.ts]
|
||||
export var foo = 42;
|
||||
|
||||
//// [c.js]
|
||||
"use strict";
|
||||
exports.foo = 42;
|
||||
//// [b.js]
|
||||
"use strict";
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
__export(require("./c"));
|
||||
//// [a.js]
|
||||
"use strict";
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
__export(require("./b"));
|
||||
__export(require("./c"));
|
||||
@@ -0,0 +1,11 @@
|
||||
=== tests/cases/compiler/a.ts ===
|
||||
export * from "./b";
|
||||
No type information for this code.export * from "./c";
|
||||
No type information for this code.
|
||||
No type information for this code.=== tests/cases/compiler/b.ts ===
|
||||
export * from "./c";
|
||||
No type information for this code.
|
||||
No type information for this code.=== tests/cases/compiler/c.ts ===
|
||||
export var foo = 42;
|
||||
>foo : Symbol(foo, Decl(c.ts, 0, 10))
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
=== tests/cases/compiler/a.ts ===
|
||||
export * from "./b";
|
||||
No type information for this code.export * from "./c";
|
||||
No type information for this code.
|
||||
No type information for this code.=== tests/cases/compiler/b.ts ===
|
||||
export * from "./c";
|
||||
No type information for this code.
|
||||
No type information for this code.=== tests/cases/compiler/c.ts ===
|
||||
export var foo = 42;
|
||||
>foo : number
|
||||
>42 : number
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// @module: commonjs
|
||||
// @filename: a.ts
|
||||
export * from "./b";
|
||||
export * from "./c";
|
||||
|
||||
// @filename: b.ts
|
||||
export * from "./c";
|
||||
|
||||
// @filename: c.ts
|
||||
export var foo = 42;
|
||||
Reference in New Issue
Block a user