Files
tsgo/testdata/baselines/reference/submodule/conformance/ModuleAndClassWithSameNameAndCommonRoot.errors.txt

45 lines
1.6 KiB
Plaintext

module.ts(2,22): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged.
simple.ts(1,11): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged.
simple.ts(2,31): error TS2449: Class 'A' used before its declaration.
simple.ts(7,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
==== module.ts (1 errors) ====
namespace X.Y {
export namespace Point {
~~~~~
!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged.
export var Origin = new Point(0, 0);
}
}
==== classPoint.ts (0 errors) ====
namespace X.Y {
// duplicate identifier
export class Point {
constructor(x: number, y: number) {
this.x = x;
this.y = y;
}
x: number;
y: number;
}
}
==== simple.ts (3 errors) ====
namespace A {
~
!!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged.
export var Instance = new A();
~
!!! error TS2449: Class 'A' used before its declaration.
!!! related TS2728 simple.ts:6:7: 'A' is declared here.
}
// duplicate identifier
class A {
id: string;
~~
!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
}