2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/conformance/internalModules/codeGeneration/nameCollision.ts ===
|
|
|
|
module A {
|
2014-08-28 21:40:58 +02:00
|
|
|
>A : typeof A
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// these 2 statements force an underscore before the 'A'
|
|
|
|
// in the generated function call.
|
|
|
|
var A = 12;
|
|
|
|
>A : number
|
|
|
|
|
|
|
|
var _A = '';
|
|
|
|
>_A : string
|
|
|
|
}
|
|
|
|
|
|
|
|
module B {
|
2014-08-28 21:40:58 +02:00
|
|
|
>B : typeof B
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var A = 12;
|
|
|
|
>A : number
|
|
|
|
}
|
|
|
|
|
|
|
|
module B {
|
2014-08-28 21:40:58 +02:00
|
|
|
>B : typeof B
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// re-opened module with colliding name
|
|
|
|
// this should add an underscore.
|
|
|
|
class B {
|
|
|
|
>B : B
|
|
|
|
|
|
|
|
name: string;
|
|
|
|
>name : string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module X {
|
2014-08-28 21:40:58 +02:00
|
|
|
>X : typeof X
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var X = 13;
|
|
|
|
>X : number
|
|
|
|
|
|
|
|
export module Y {
|
2014-08-28 21:40:58 +02:00
|
|
|
>Y : typeof X.Y
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var Y = 13;
|
|
|
|
>Y : number
|
|
|
|
|
|
|
|
export module Z {
|
2014-08-28 21:40:58 +02:00
|
|
|
>Z : typeof X.Y.Z
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var X = 12;
|
|
|
|
>X : number
|
|
|
|
|
|
|
|
var Y = 12;
|
|
|
|
>Y : number
|
|
|
|
|
|
|
|
var Z = 12;
|
|
|
|
>Z : number
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module Y.Y {
|
2014-08-28 21:40:58 +02:00
|
|
|
>Y : typeof Y
|
|
|
|
>Y : typeof Y.Y
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export enum Y {
|
|
|
|
>Y : Y
|
|
|
|
|
|
|
|
Red, Blue
|
|
|
|
>Red : Y
|
|
|
|
>Blue : Y
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// no collision, since interface doesn't
|
|
|
|
// generate code.
|
|
|
|
module D {
|
2014-08-28 21:40:58 +02:00
|
|
|
>D : typeof D
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export interface D {
|
|
|
|
>D : D
|
|
|
|
|
|
|
|
id: number;
|
|
|
|
>id : number
|
|
|
|
}
|
|
|
|
|
|
|
|
export var E = 'hello';
|
|
|
|
>E : string
|
|
|
|
}
|