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

In 5.7 beta, BigInt64ArrayConstructor mismatches with other typed arrays #60367

Closed
trevorade opened this issue Oct 29, 2024 · 0 comments Β· Fixed by #60391
Closed

In 5.7 beta, BigInt64ArrayConstructor mismatches with other typed arrays #60367

trevorade opened this issue Oct 29, 2024 · 0 comments Β· Fixed by #60391
Assignees
Labels
Fix Available A PR has been opened for this issue

Comments

@trevorade
Copy link

πŸ”Ž Search Terms

"BigInt64Array", "typed array"

πŸ•— Version & Regression Information

  • This changed between versions 5.6.3 and 5.7.0-beta

⏯ Playground Link

https://www.typescriptlang.org/play/?target=11&ts=5.7.0-beta#code/PTAEGEFcCdoUwHYBdQDoAmqkGdQDc5psBLAewQCgKkBPABzlABV650BBWAQxvHOyTRIAYySlooALwVQs0CGbQaoYaQC2axEmIIA5qHKMuCdKCQALRGcsGLhAwDNrcbHFTMbAIzgAbUgHdQQmhxUF1SF1Aufx5UGTkAH1AAMT8uJAA2ABZOaB4+BAEhUXF42SSAIWJdAElkbNz8-kERMWgqOAAPOnEUB0gEUTIEUDUuAGs4FgYObhoACk9IBwdCAC5QRpoK5dXoABoVQQ3pti2CotbxAEpQAG94+CQYEYQ4QNFoRd3Ca4BuCgAXyoVAUAFlSOhiA5iFxPD5GAQiMMzKRQNhzAFhFxXKAetgSPDGDDOlRaAxQGCaKdZnleM1im0pGVQEkqalSOkGnMLi0Su05KzKdtqnVMjkeQyru0KF0etA+gMhuRRhM4FSaVtvit1ps5jsdQcjtANhrWLSmoU+W1bg9ZE8XqA3h9BNq9v8gVQdEhCA4uMJGFSqrV6hK6bzGaE7XJ4Fx0OQfMo6CExOS4KaRSHxVsADxbA17AAyxEmAD4ASyFFBYFozPQdLpcPNVBpaxZiLhSJAkNcWc7QPMEXoLAB+DYISBqbzQa4Z4Ni7l0vP6n7QctUQUKADKkF0uhcPtMkDo6HSbDrdAbuAs6VA8GwpB8BGvNjhpAIoCW+nmSvUmmQzi4j4OguL2m5gP28yzsK86hrm+aruu4FOu8A5DroFjjpO07QUGopwXMy50gWhDrn2qHzFwcwbFsxaTDmnjVN6pZCjUPp5ESDFMcgpa4ZmC5hjwRE8CRa4AoK-Y5kwCGGkEnQ+iYuAyUWJaMJIerEYhbq6tJK6Gocng0D6ADyKyuEgY5OthhCHOho5YVOvxzvh2aEbpmmGuuwLer6-qBvxBFLu5ImrnJCnoEpekqZMUgaSFhp0XALHRrIADaOjoF0DnTgAuhsjG6N6ALAhQPnQH6AbChyXKCfSVqRhIKV3nAcYJkmKakGmGbVa5S7KYQiVIXICgACJwDCbymDoQTYAATAADAAjAA7Fg5pUXSL5dro5igDowg+JAmWmJY8CgA4oSqAgBAIMQiABnEEkUXxPWLkJ-VieRgSDogGHmNlTlVWkvXvVFpHiXIkEbTwNFzIlOYTo5a4vcDb00MJ2yIRDsiScFmOyV04WRR50VqXF+N7KW2kmswH0GUZcCmQ45mWYj062b99lWUjKOciD6N46JQ04xR0M0LDdLw2zpFCh9vM1fBYOfd5yC+ZV7Ko7VUkfWFiAReTomJbFH2DfcLLpSYWXc7lAPQMVFBAA

πŸ’» Code

type TypedArrayConstructor =
    | Float64ArrayConstructor
    | BigInt64ArrayConstructor

export function makeTypedArray(buffer: ArrayBuffer, ctr: TypedArrayConstructor) {
  return new ctr(buffer);  // Incorrect error here.
}

πŸ™ Actual behavior

new ctr(buffer) produces error:

No overload matches this call.
  Overload 1 of 4, '(length: number): Float64Array<ArrayBuffer> | BigInt64Array<ArrayBuffer>', gave the following error.
    Argument of type 'ArrayBuffer' is not assignable to parameter of type 'number'.
  Overload 2 of 4, '(length?: number | undefined): Float64Array<ArrayBuffer> | BigInt64Array<ArrayBuffer>', gave the following error.
    Argument of type 'ArrayBuffer' is not assignable to parameter of type 'number'.
  Overload 3 of 4, '(array: ArrayLike<bigint> | Iterable<bigint>): Float64Array<ArrayBuffer> | BigInt64Array<ArrayBuffer>', gave the following error.
    Argument of type 'ArrayBuffer' is not assignable to parameter of type 'ArrayLike<bigint> | Iterable<bigint>'.

πŸ™‚ Expected behavior

Compiles without any error.

Additional information about the issue

Google code location where this reproduces: http://shortn/_EriWkk8A2g

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Oct 31, 2024
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 5.7.1 milestone Oct 31, 2024
@typescript-bot typescript-bot added Fix Available A PR has been opened for this issue labels Nov 1, 2024
@rbuckton rbuckton removed the Needs Investigation This issue needs a team member to investigate its status. label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Available A PR has been opened for this issue
Projects
None yet
4 participants