66 lines
No EOL
1.4 KiB
Text
66 lines
No EOL
1.4 KiB
Text
==== tests/cases/compiler/nameCollisions.ts (9 errors) ====
|
|
module T {
|
|
var x = 2;
|
|
|
|
module x { // error
|
|
~
|
|
!!! Duplicate identifier 'x'.
|
|
export class Bar {
|
|
test: number;
|
|
}
|
|
}
|
|
|
|
module z {
|
|
var t;
|
|
}
|
|
var z; // error
|
|
~
|
|
!!! Duplicate identifier 'z'.
|
|
|
|
module y {
|
|
~
|
|
!!! A module declaration cannot be located prior to a class or function with which it is merged
|
|
var b;
|
|
}
|
|
|
|
class y { } // error
|
|
|
|
var w;
|
|
module w { } //ok
|
|
|
|
var f;
|
|
function f() { } //error
|
|
~
|
|
!!! Duplicate identifier 'f'.
|
|
|
|
function f2() { }
|
|
var f2; // error
|
|
~~
|
|
!!! Duplicate identifier 'f2'.
|
|
|
|
var i;
|
|
interface i { } //ok
|
|
|
|
class C { }
|
|
function C() { } // error
|
|
~
|
|
!!! Duplicate identifier 'C'.
|
|
|
|
function C2() { }
|
|
class C2 { } // error
|
|
~~
|
|
!!! Duplicate identifier 'C2'.
|
|
|
|
function fi() { }
|
|
interface fi { } // ok
|
|
|
|
class cli { }
|
|
interface cli { } // error
|
|
~~~
|
|
!!! Duplicate identifier 'cli'.
|
|
|
|
interface cli2 { }
|
|
class cli2 { } // error
|
|
~~~~
|
|
!!! Duplicate identifier 'cli2'.
|
|
} |