Skip to content
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

Empty constructors for TypedArrays are not allowed #19680

Closed
ltetzlaff opened this issue Nov 2, 2017 · 3 comments
Closed

Empty constructors for TypedArrays are not allowed #19680

ltetzlaff opened this issue Nov 2, 2017 · 3 comments
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript ES2017 Relates to the ES2017 Spec Fixed A PR has been merged for this issue Good First Issue Well scoped, documented and has the green light Help Wanted You can do this

Comments

@ltetzlaff
Copy link

ltetzlaff commented Nov 2, 2017

Typescript currently does not support empty constructors of TypedArrays, as in mdn UInt8Array, thx to sindresorhus for pointing that out.

TypeScript Version: 2.7.0-dev.201xxxxx

Code

const x = new Uint8Array()

Expected behavior:
works
Actual behavior:
Error: Expected 1-3 arguments, but got 0.

@mhegazy
Copy link
Contributor

mhegazy commented Nov 2, 2017

This is an ES 2017 specific change, should go in a new file src/lib/es2017.typedArrays.d.ts and linked from https://github.com/Microsoft/TypeScript/blob/master/src/lib/es2017.d.ts.

@mhegazy
Copy link
Contributor

mhegazy commented Nov 2, 2017

PRs welcomed.

@mhegazy mhegazy added ES2017 Relates to the ES2017 Spec Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this labels Nov 2, 2017
@mhegazy mhegazy added this to the Community milestone Nov 2, 2017
@mhegazy mhegazy added the Good First Issue Well scoped, documented and has the green light label Nov 2, 2017
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Nov 6, 2017
@mhegazy mhegazy modified the milestones: Community, TypeScript 2.7 Nov 6, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Nov 6, 2017

thanks @timocov!

@mhegazy mhegazy closed this as completed Nov 6, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
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 ES2017 Relates to the ES2017 Spec Fixed A PR has been merged for this issue Good First Issue Well scoped, documented and has the green light Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

2 participants