Skip to content

Can't concat ReadonlyArray #17076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Jul 10, 2017 · 0 comments
Closed

Can't concat ReadonlyArray #17076

ghost opened this issue Jul 10, 2017 · 0 comments
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

Comments

@ghost
Copy link

ghost commented Jul 10, 2017

TypeScript Version: nightly (2.5.0-dev.20170707)

Code

const x: ReadonlyArray<number> = [0];
x.concat(x);

Expected behavior:

No error.

Actual behavior:

src/a.ts(2,10): error TS2345: Argument of type 'ReadonlyArray<number>' is not assignable to parameter of type 'number | number[]'.
  Type 'ReadonlyArray<number>' is not assignable to type 'number[]'.
    Property 'push' is missing in type 'ReadonlyArray<number>'.
@DanielRosenwasser DanielRosenwasser added the Bug A bug in TypeScript label Jul 10, 2017
@DanielRosenwasser DanielRosenwasser added the Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript label Aug 15, 2017
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 2.5.1 milestone Aug 15, 2017
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Aug 16, 2017
@mhegazy mhegazy modified the milestones: TypeScript 2.6, TypeScript 2.5.1 Aug 16, 2017
@ghost ghost closed this as completed in #17806 Aug 16, 2017
mattacosta added a commit to mattacosta/php-parser that referenced this issue Dec 28, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

No branches or pull requests

2 participants