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
|
tests/cases/compiler/file1.ts(4,7): error TS2300: Duplicate identifier 'C2'.
tests/cases/compiler/file1.ts(5,10): error TS2300: Duplicate identifier 'f'.
tests/cases/compiler/file1.ts(9,12): error TS2300: Duplicate identifier 'x'.
tests/cases/compiler/file2.ts(3,10): error TS2300: Duplicate identifier 'C2'.
tests/cases/compiler/file2.ts(4,7): error TS2300: Duplicate identifier 'f'.
tests/cases/compiler/file2.ts(7,8): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged
tests/cases/compiler/file2.ts(8,16): error TS2300: Duplicate identifier 'x'.
==== tests/cases/compiler/file1.ts (3 errors) ====
interface I { }
class C1 { }
class C2 { }
~~
!!! error TS2300: Duplicate identifier 'C2'.
function f() { }
~
!!! error TS2300: Duplicate identifier 'f'.
var v = 3;
class Foo {
static x: number;
~
!!! error TS2300: Duplicate identifier 'x'.
}
module N {
export module F {
var t;
}
}
==== tests/cases/compiler/file2.ts (4 errors) ====
class I { } // error -- cannot merge interface with non-ambient class
interface C1 { } // error -- cannot merge interface with non-ambient class
function C2() { } // error -- cannot merge function with non-ambient class
~~
!!! error TS2300: Duplicate identifier 'C2'.
class f { } // error -- cannot merge function with non-ambient class
~
!!! error TS2300: Duplicate identifier 'f'.
var v = 3;
module Foo {
~~~
!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged
export var x: number; // error for redeclaring var in a different parent
~
!!! error TS2300: Duplicate identifier 'x'.
}
declare module N {
export function F(); // no error because function is ambient
}
|