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

error: The name 'onSet' is already defined #1184

Open
deadsoul44 opened this issue Aug 23, 2022 · 3 comments
Open

error: The name 'onSet' is already defined #1184

deadsoul44 opened this issue Aug 23, 2022 · 3 comments
Assignees
Labels

Comments

@deadsoul44
Copy link

deadsoul44 commented Aug 23, 2022

I am not sure why this is happening but for only some generated classes, I get this error.

  ListBuilder<Event>? _events;
  ListBuilder<Event> get events => _$this._events ??= new ListBuilder<Event>();
  void Function() onSet = () {};

  set events(ListBuilder<Event>? events) {
    _$this._events = events;
    onSet();
  }

There are same onSet definitions for every field.

@deadsoul44
Copy link
Author

This is happening when @BuiltValue(generateBuilderOnSetField: true).

@davidmorgan
Copy link
Collaborator

Have you defined something yourself in the class called onSet? That would be one possible explanation ;)

@davidmorgan davidmorgan self-assigned this Aug 24, 2022
@deadsoul44
Copy link
Author

No :)

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

No branches or pull requests

2 participants