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

the type of super() should be instance, not void #37847

Open
LongTengDao opened this issue Apr 8, 2020 · 5 comments
Open

the type of super() should be instance, not void #37847

LongTengDao opened this issue Apr 8, 2020 · 5 comments
Labels
Has Repro This issue has compiler-backed repros: https://aka.ms/ts-repros Needs Investigation This issue needs a team member to investigate its status.
Milestone

Comments

@LongTengDao
Copy link
Contributor

LongTengDao commented Apr 8, 2020

TypeScript Version: 3.8.3

Search Terms:

Code

class Sub extends Super {
  constructor () { return super(); }
}

Expected behavior: no error

Actual behavior: TS2322

Playground Link:

Related Issues:

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Apr 20, 2020
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Apr 20, 2020
@LongTengDao
Copy link
Contributor Author

LongTengDao commented Oct 26, 2020

addon:

class Sub extends Super {
  a :1;
  constructor () {
    super().a;// better to be able to warn not init yet
    this.a = 1;
    this.a;// ok now
  }
}

@ghost
Copy link

ghost commented Jan 13, 2021

Are there any plans on fixing (investigating) this any time soon?

@cangSDARM
Copy link

any news or update?

Recently, tsc compiled super to an inline anonymous function, I wonder why

image

@ExE-Boss
Copy link
Contributor

@cangSDARM
Can you post the source code which reproduces that bug with the relevant tsconfig.json configuration?

```ts repro
// source code here
```

[Workbench Repro](https://www.typescriptlang.org/dev/bug-workbench/)

@typescript-bot typescript-bot added the Has Repro This issue has compiler-backed repros: https://aka.ms/ts-repros label Dec 11, 2023
@cangSDARM
Copy link

@cangSDARM Can you post the source code which reproduces that bug with the relevant tsconfig.json configuration?

```ts repro
// source code here

Workbench Repro

Sry, my mistake. I did a little more digging, and this is esbuild issue :) evanw/esbuild#3538

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Has Repro This issue has compiler-backed repros: https://aka.ms/ts-repros Needs Investigation This issue needs a team member to investigate its status.
Projects
None yet
Development

No branches or pull requests

5 participants