swc/crates/swc_ecma_parser/tests/tsc/nameCollision.ts

46 lines
713 B
TypeScript
Raw Normal View History

module A {
// these 2 statements force an underscore before the 'A'
// in the generated function call.
var A = 12;
var _A = '';
}
module B {
var A = 12;
}
module B {
// re-opened module with colliding name
// this should add an underscore.
class B {
name: string;
}
}
module X {
var X = 13;
export module Y {
var Y = 13;
export module Z {
var X = 12;
var Y = 12;
var Z = 12;
}
}
}
module Y.Y {
export enum Y {
Red, Blue
}
}
// no collision, since interface doesn't
// generate code.
module D {
export interface D {
id: number;
}
export var E = 'hello';
}