88 lines
2.1 KiB
Text
88 lines
2.1 KiB
Text
=== tests/cases/conformance/internalModules/codeGeneration/nameCollision.ts ===
|
|
module A {
|
|
>A : Symbol(A, Decl(nameCollision.ts, 0, 0))
|
|
|
|
// these 2 statements force an underscore before the 'A'
|
|
// in the generated function call.
|
|
var A = 12;
|
|
>A : Symbol(A, Decl(nameCollision.ts, 3, 7))
|
|
|
|
var _A = '';
|
|
>_A : Symbol(_A, Decl(nameCollision.ts, 4, 7))
|
|
}
|
|
|
|
module B {
|
|
>B : Symbol(B, Decl(nameCollision.ts, 5, 1), Decl(nameCollision.ts, 9, 1))
|
|
|
|
var A = 12;
|
|
>A : Symbol(A, Decl(nameCollision.ts, 8, 7))
|
|
}
|
|
|
|
module B {
|
|
>B : Symbol(B, Decl(nameCollision.ts, 5, 1), Decl(nameCollision.ts, 9, 1))
|
|
|
|
// re-opened module with colliding name
|
|
// this should add an underscore.
|
|
class B {
|
|
>B : Symbol(B, Decl(nameCollision.ts, 11, 10))
|
|
|
|
name: string;
|
|
>name : Symbol(name, Decl(nameCollision.ts, 14, 13))
|
|
}
|
|
}
|
|
|
|
module X {
|
|
>X : Symbol(X, Decl(nameCollision.ts, 17, 1))
|
|
|
|
var X = 13;
|
|
>X : Symbol(X, Decl(nameCollision.ts, 20, 7))
|
|
|
|
export module Y {
|
|
>Y : Symbol(Y, Decl(nameCollision.ts, 20, 15))
|
|
|
|
var Y = 13;
|
|
>Y : Symbol(Y, Decl(nameCollision.ts, 22, 11))
|
|
|
|
export module Z {
|
|
>Z : Symbol(Z, Decl(nameCollision.ts, 22, 19))
|
|
|
|
var X = 12;
|
|
>X : Symbol(X, Decl(nameCollision.ts, 24, 15))
|
|
|
|
var Y = 12;
|
|
>Y : Symbol(Y, Decl(nameCollision.ts, 25, 15))
|
|
|
|
var Z = 12;
|
|
>Z : Symbol(Z, Decl(nameCollision.ts, 26, 15))
|
|
}
|
|
}
|
|
}
|
|
|
|
module Y.Y {
|
|
>Y : Symbol(Y, Decl(nameCollision.ts, 29, 1))
|
|
>Y : Symbol(Y, Decl(nameCollision.ts, 31, 9))
|
|
|
|
export enum Y {
|
|
>Y : Symbol(Y, Decl(nameCollision.ts, 31, 12))
|
|
|
|
Red, Blue
|
|
>Red : Symbol(Y.Red, Decl(nameCollision.ts, 32, 19))
|
|
>Blue : Symbol(Y.Blue, Decl(nameCollision.ts, 33, 12))
|
|
}
|
|
}
|
|
|
|
// no collision, since interface doesn't
|
|
// generate code.
|
|
module D {
|
|
>D : Symbol(D, Decl(nameCollision.ts, 35, 1))
|
|
|
|
export interface D {
|
|
>D : Symbol(D, Decl(nameCollision.ts, 39, 10))
|
|
|
|
id: number;
|
|
>id : Symbol(id, Decl(nameCollision.ts, 40, 24))
|
|
}
|
|
|
|
export var E = 'hello';
|
|
>E : Symbol(E, Decl(nameCollision.ts, 44, 14))
|
|
}
|