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

abstract class should be usable in expressions #59031

Open
6 tasks done
stwlam opened this issue Jun 26, 2024 · 3 comments
Open
6 tasks done

abstract class should be usable in expressions #59031

stwlam opened this issue Jun 26, 2024 · 3 comments
Labels
Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript

Comments

@stwlam
Copy link

stwlam commented Jun 26, 2024

πŸ” Search Terms

abstract, class, expression

βœ… Viability Checklist

⭐ Suggestion

function myMixin(Base: typeof Object) {
  return abstract class Mixed extends Base {};
}

πŸ“ƒ Motivating Example

Preferable to:

function myMixin(Base: typeof Object) {
  abstract class Mixed extends Base {}
  return Mixed;
}

πŸ’» Use Cases

  1. What do you want to use this for?
    Same uses as without
  2. What shortcomings exist with current approaches?
    Slight additional verbosity
  3. What workarounds are you using in the meantime?
    Slight additional verbosity
@whzx5byb
Copy link

#4578 was declined, but since it's 9 years, maybe it's time to revisit it.

@stwlam
Copy link
Author

stwlam commented Jun 26, 2024

#4578 was declined, but since it's 9 years, maybe it's time to revisit it.

Interesting!
image

@stwlam
Copy link
Author

stwlam commented Jun 26, 2024

Some additional issue corralling: it looks like the reporter of #32122 was basically running into the same problem, though the errors they pasted aren't the same.

@RyanCavanaugh RyanCavanaugh added Suggestion An idea for TypeScript Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature labels Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants