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

Polymorphic TypedArray methods return wrong type in subclasses #38665

Open
seishun opened this issue May 19, 2020 · 0 comments
Open

Polymorphic TypedArray methods return wrong type in subclasses #38665

seishun opened this issue May 19, 2020 · 0 comments
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript
Milestone

Comments

@seishun
Copy link

seishun commented May 19, 2020

TypeScript Version: 4.0.0-dev.20200519

Search Terms:
typedarray subarray polymorphic
Code

class Buf extends Uint8Array {
  foo() {}
}

new Buf(10).subarray().foo()

Expected behavior:
No error.
Actual behavior:
error TS2339: Property 'foo' does not exist on type 'Uint8Array'.
Playground Link: Playground Link

Related Issues:

@RyanCavanaugh RyanCavanaugh added 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 and removed Help Wanted You can do this labels Jun 9, 2020
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript
Projects
None yet
Development

No branches or pull requests

2 participants