mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
24 lines
872 B
Plaintext
24 lines
872 B
Plaintext
assignToExistingClass.ts(3,9): error TS2564: Property 'myProp' has no initializer and is not definitely assigned in the constructor.
|
|
assignToExistingClass.ts(8,13): error TS2629: Cannot assign to 'Mocked' because it is a class.
|
|
|
|
|
|
==== assignToExistingClass.ts (2 errors) ====
|
|
namespace Test {
|
|
class Mocked {
|
|
myProp: string;
|
|
~~~~~~
|
|
!!! error TS2564: Property 'myProp' has no initializer and is not definitely assigned in the constructor.
|
|
}
|
|
|
|
class Tester {
|
|
willThrowError() {
|
|
Mocked = Mocked || function () { // => Error: Invalid left-hand side of assignment expression.
|
|
~~~~~~
|
|
!!! error TS2629: Cannot assign to 'Mocked' because it is a class.
|
|
return { myProp: "test" };
|
|
};
|
|
}
|
|
}
|
|
|
|
}
|
|
|