mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
34 lines
1.1 KiB
Plaintext
34 lines
1.1 KiB
Plaintext
classAbstractClinterfaceAssignability.ts(15,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor.
|
|
classAbstractClinterfaceAssignability.ts(23,1): error TS2322: Type 'typeof A' is not assignable to type 'IConstructor'.
|
|
Cannot assign an abstract constructor type to a non-abstract constructor type.
|
|
|
|
|
|
==== classAbstractClinterfaceAssignability.ts (2 errors) ====
|
|
interface I {
|
|
x: number;
|
|
}
|
|
|
|
interface IConstructor {
|
|
new (): I;
|
|
|
|
y: number;
|
|
prototype: I;
|
|
}
|
|
|
|
declare var I: IConstructor;
|
|
|
|
abstract class A {
|
|
x: number;
|
|
~
|
|
!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor.
|
|
static y: number;
|
|
}
|
|
|
|
declare var AA: typeof A;
|
|
AA = I;
|
|
|
|
declare var AAA: typeof I;
|
|
AAA = A;
|
|
~~~
|
|
!!! error TS2322: Type 'typeof A' is not assignable to type 'IConstructor'.
|
|
!!! error TS2322: Cannot assign an abstract constructor type to a non-abstract constructor type. |