mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
61 lines
2.6 KiB
Plaintext
61 lines
2.6 KiB
Plaintext
file1.ts(3,7): error TS2813: Class declaration cannot implement overload list for 'C2'.
|
|
file1.ts(4,10): error TS2814: Function with bodies can only merge with classes that are ambient.
|
|
file1.ts(8,12): error TS2300: Duplicate identifier 'x'.
|
|
file2.ts(3,10): error TS2814: Function with bodies can only merge with classes that are ambient.
|
|
file2.ts(4,7): error TS2813: Class declaration cannot implement overload list for 'f'.
|
|
file2.ts(7,11): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged.
|
|
file2.ts(8,16): error TS2300: Duplicate identifier 'x'.
|
|
|
|
|
|
==== file1.ts (3 errors) ====
|
|
interface I { }
|
|
class C1 { }
|
|
class C2 { }
|
|
~~
|
|
!!! error TS2813: Class declaration cannot implement overload list for 'C2'.
|
|
!!! related TS6506 file1.ts:3:7: Consider adding a 'declare' modifier to this class.
|
|
function f() { }
|
|
~
|
|
!!! error TS2814: Function with bodies can only merge with classes that are ambient.
|
|
!!! related TS6506 file2.ts:4:7: Consider adding a 'declare' modifier to this class.
|
|
var v = 3;
|
|
|
|
class Foo {
|
|
static x: number;
|
|
~
|
|
!!! error TS2300: Duplicate identifier 'x'.
|
|
!!! related TS6203 file2.ts:8:16: 'x' was also declared here.
|
|
}
|
|
|
|
namespace N {
|
|
export namespace F {
|
|
var t;
|
|
}
|
|
}
|
|
|
|
==== 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 TS2814: Function with bodies can only merge with classes that are ambient.
|
|
!!! related TS6506 file1.ts:3:7: Consider adding a 'declare' modifier to this class.
|
|
class f { } // error -- cannot merge function with non-ambient class
|
|
~
|
|
!!! error TS2813: Class declaration cannot implement overload list for 'f'.
|
|
!!! related TS6506 file2.ts:4:7: Consider adding a 'declare' modifier to this class.
|
|
var v = 3;
|
|
|
|
namespace 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'.
|
|
!!! related TS6203 file1.ts:8:12: 'x' was also declared here.
|
|
}
|
|
|
|
declare namespace N {
|
|
export function F(); // no error because function is ambient
|
|
}
|
|
|