Array not assignable to ReadonlyArray with subclass items #10368
Labels
Bug
A bug in TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Fixed
A PR has been merged for this issue
Milestone
TypeScript Version: 2.0.0
Code
Expected behavior:
To compile.
Actual behavior:
error TS2345: Argument of type 'B[]' is not assignable to parameter of type 'ReadonlyArray'.
Types of property 'concat' are incompatible.
Type '(...items: (B | B[])[]) => B[]' is not assignable to type '{ <U extends ReadonlyArray>(...items: U[]): A[]; (...items: A[]): A[]; }'.
Types of parameters 'items' and 'items' are incompatible.
Type 'A' is not assignable to type 'B | B[]'.
Type 'A' is not assignable to type 'B[]'.
Property 'length' is missing in type 'A'.
The text was updated successfully, but these errors were encountered: