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 concrete members #83

Closed
rrousselGit opened this issue Mar 3, 2020 · 2 comments · Fixed by #98
Closed

Support concrete members #83

rrousselGit opened this issue Mar 3, 2020 · 2 comments · Fixed by #98
Labels
enhancement New feature or request

Comments

@rrousselGit
Copy link
Owner

rrousselGit commented Mar 3, 2020

Multiple issues are requesting support for members implemented on the user-defined class directly (#65 #11 #33)

These are basically all the same issue: supporting concrete members.

This could be done by adding a concrete constructor on the user-defined class, and make the generated class extends the user-defined class using this constructor:

@freezed
abstract class Concrete with _$Concrete {
  Concrete._();
  factory Concrete(int value) = _Concrete;

  void method() {
  }
}
@rrousselGit
Copy link
Owner Author

I don't see any way to check if toString is the default implementation or not.

Any thought @passy?

@rrousselGit
Copy link
Owner Author

Actually, I've found a way to do that.

It involves traversing all the supertypes to see if they define a toString method though – that's pretty expensive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant