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

Support generic type T to extend multiple classes #4195

Closed
nathnaeld opened this issue Dec 5, 2024 · 1 comment
Closed

Support generic type T to extend multiple classes #4195

nathnaeld opened this issue Dec 5, 2024 · 1 comment
Labels
feature Proposed language feature that solves one or more problems state-duplicate This issue or pull request already exists

Comments

@nathnaeld
Copy link

Currently, generic types can only extend one class. Allow extending multiple classes to enhance flexibility.

Example syntax:

class User<T extends int & String> {
  final T id;
  // Implementation
}

// Or

class User<T extends int | String> {
  final T id;
  // Implementation
}
@nathnaeld nathnaeld added the feature Proposed language feature that solves one or more problems label Dec 5, 2024
@mateusfccp
Copy link
Contributor

Duplicate of #2709.

@lrhn lrhn closed this as completed Dec 5, 2024
@lrhn lrhn added the state-duplicate This issue or pull request already exists label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Proposed language feature that solves one or more problems state-duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants