2014-07-13 01:04:16 +02:00
|
|
|
//// [duplicateSymbolsExportMatching.ts]
|
|
|
|
module M {
|
|
|
|
export interface E { }
|
|
|
|
interface I { }
|
|
|
|
}
|
|
|
|
module M {
|
|
|
|
export interface E { } // ok
|
|
|
|
interface I { } // ok
|
|
|
|
}
|
|
|
|
|
|
|
|
// Doesn't match export visibility, but it's in a different parent, so it's ok
|
|
|
|
module M {
|
|
|
|
interface E { } // ok
|
|
|
|
export interface I { } // ok
|
|
|
|
}
|
|
|
|
|
|
|
|
module N {
|
|
|
|
interface I { }
|
|
|
|
interface I { } // ok
|
|
|
|
export interface E { }
|
|
|
|
export interface E { } // ok
|
|
|
|
}
|
|
|
|
|
|
|
|
module N2 {
|
|
|
|
interface I { }
|
|
|
|
export interface I { } // error
|
|
|
|
export interface E { }
|
|
|
|
interface E { } // error
|
|
|
|
}
|
|
|
|
|
|
|
|
// Should report error only once for instantiated module
|
|
|
|
module M {
|
|
|
|
module inst {
|
|
|
|
var t;
|
|
|
|
}
|
|
|
|
export module inst { // one error
|
|
|
|
var t;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Variables of the same / different type
|
|
|
|
module M2 {
|
|
|
|
var v: string;
|
|
|
|
export var v: string; // one error (visibility)
|
|
|
|
var w: number;
|
|
|
|
export var w: string; // two errors (visibility and type mismatch)
|
|
|
|
}
|
|
|
|
|
|
|
|
module M {
|
|
|
|
module F {
|
|
|
|
var t;
|
|
|
|
}
|
|
|
|
export function F() { } // Only one error for duplicate identifier (don't consider visibility)
|
|
|
|
}
|
|
|
|
|
|
|
|
module M {
|
|
|
|
class C { }
|
|
|
|
module C { }
|
|
|
|
export module C { // Two visibility errors (one for the clodule symbol, and one for the merged container symbol)
|
|
|
|
var t;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Top level
|
|
|
|
interface D { }
|
|
|
|
export interface D { }
|
|
|
|
|
|
|
|
//// [duplicateSymbolsExportMatching.js]
|
|
|
|
define(["require", "exports"], function (require, exports) {
|
2014-08-14 15:53:37 +02:00
|
|
|
// Should report error only once for instantiated module
|
2014-07-13 01:04:16 +02:00
|
|
|
var M;
|
|
|
|
(function (M) {
|
|
|
|
var inst;
|
|
|
|
(function (inst) {
|
|
|
|
var t;
|
|
|
|
})(inst || (inst = {}));
|
2014-09-07 02:40:19 +02:00
|
|
|
var inst;
|
2014-07-13 01:04:16 +02:00
|
|
|
(function (inst) {
|
|
|
|
var t;
|
2014-09-07 02:40:19 +02:00
|
|
|
})(inst = M.inst || (M.inst = {}));
|
2014-07-13 01:04:16 +02:00
|
|
|
})(M || (M = {}));
|
2014-08-14 15:53:37 +02:00
|
|
|
// Variables of the same / different type
|
2014-07-13 01:04:16 +02:00
|
|
|
var M2;
|
|
|
|
(function (M2) {
|
|
|
|
var v;
|
2014-08-15 22:18:54 +02:00
|
|
|
M2.v; // one error (visibility)
|
2014-07-13 01:04:16 +02:00
|
|
|
var w;
|
2014-08-15 22:18:54 +02:00
|
|
|
M2.w; // two errors (visibility and type mismatch)
|
2014-07-13 01:04:16 +02:00
|
|
|
})(M2 || (M2 = {}));
|
|
|
|
var M;
|
|
|
|
(function (M) {
|
|
|
|
var F;
|
|
|
|
(function (F) {
|
|
|
|
var t;
|
|
|
|
})(F || (F = {}));
|
|
|
|
function F() {
|
|
|
|
}
|
2014-08-15 22:18:54 +02:00
|
|
|
M.F = F; // Only one error for duplicate identifier (don't consider visibility)
|
2014-07-13 01:04:16 +02:00
|
|
|
})(M || (M = {}));
|
|
|
|
var M;
|
|
|
|
(function (M) {
|
|
|
|
var C = (function () {
|
|
|
|
function C() {
|
|
|
|
}
|
|
|
|
return C;
|
|
|
|
})();
|
2014-09-07 02:40:19 +02:00
|
|
|
var C;
|
2014-07-13 01:04:16 +02:00
|
|
|
(function (C) {
|
|
|
|
var t;
|
2014-09-07 02:40:19 +02:00
|
|
|
})(C = M.C || (M.C = {}));
|
2014-07-13 01:04:16 +02:00
|
|
|
})(M || (M = {}));
|
|
|
|
});
|