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

19 lines
833 B
Plaintext

classAbstractAssignabilityConstructorFunction.ts(7,1): error TS2322: Type 'typeof A' is not assignable to type 'new () => A'.
Cannot assign an abstract constructor type to a non-abstract constructor type.
classAbstractAssignabilityConstructorFunction.ts(8,1): error TS2322: Type 'string' is not assignable to type 'new () => A'.
==== classAbstractAssignabilityConstructorFunction.ts (2 errors) ====
abstract class A { }
// var AA: typeof A;
var AAA: new() => A;
// AA = A; // okay
AAA = A; // error.
~~~
!!! error TS2322: Type 'typeof A' is not assignable to type 'new () => A'.
!!! error TS2322: Cannot assign an abstract constructor type to a non-abstract constructor type.
AAA = "asdf";
~~~
!!! error TS2322: Type 'string' is not assignable to type 'new () => A'.