1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
//// [duplicateIdentifiersAcrossContainerBoundaries.ts]
module M {
export interface I { }
}
module M {
export class I { }
}
module M {
export function f() { }
}
module M {
export class f { } // error
}
module M {
function g() { }
}
module M {
export class g { } // no error
}
module M {
export class C { }
}
module M {
function C() { } // no error
}
module M {
export var v = 3;
}
module M {
export var v = 3; // error for redeclaring var in a different parent
}
class Foo {
static x: number;
}
module Foo {
export var x: number; // error for redeclaring var in a different parent
}
module N {
export module F {
var t;
}
}
declare module N {
export function F(); // no error because function is ambient
}
//// [duplicateIdentifiersAcrossContainerBoundaries.js]
var M;
(function (M) {
var I = /** @class */ (function () {
function I() {
}
return I;
}());
M.I = I;
})(M || (M = {}));
(function (M) {
function f() { }
M.f = f;
})(M || (M = {}));
(function (M) {
var f = /** @class */ (function () {
function f() {
}
return f;
}()); // error
M.f = f;
})(M || (M = {}));
(function (M) {
function g() { }
})(M || (M = {}));
(function (M) {
var g = /** @class */ (function () {
function g() {
}
return g;
}()); // no error
M.g = g;
})(M || (M = {}));
(function (M) {
var C = /** @class */ (function () {
function C() {
}
return C;
}());
M.C = C;
})(M || (M = {}));
(function (M) {
function C() { } // no error
})(M || (M = {}));
(function (M) {
M.v = 3;
})(M || (M = {}));
(function (M) {
M.v = 3; // error for redeclaring var in a different parent
})(M || (M = {}));
var Foo = /** @class */ (function () {
function Foo() {
}
return Foo;
}());
(function (Foo) {
})(Foo || (Foo = {}));
var N;
(function (N) {
var F;
(function (F) {
var t;
})(F = N.F || (N.F = {}));
})(N || (N = {}));
|