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

Annotaions that are attached to the enum elements are not visible #491

Open
Zhen-hao opened this issue Sep 3, 2023 · 4 comments
Open

Annotaions that are attached to the enum elements are not visible #491

Zhen-hao opened this issue Sep 3, 2023 · 4 comments

Comments

@Zhen-hao
Copy link

Zhen-hao commented Sep 3, 2023

While working on sksamuel/avro4s#791 I realized that the 2nd item in the todo list is blocked by the fact we couldn't obtain annotations that are attached to the enum elements via magnolia (1.3.3).

In particular, I'm testing with

import com.sksamuel.avro4s.AvroSortPriority

enum ColoursAnnotatedEnum:
  @AvroSortPriority(0)
  case Red
  @AvroSortPriority(1)
  case Amber
  @AvroSortPriority(2)
  case Green

Is this a well-known issue that won't be fixed in magnolia?

@adamw
Copy link
Member

adamw commented Sep 6, 2023

@Zhen-hao no, I can't recall this being a "no-fix" issue :). Parameterless-enums are a bit special (as the cases don't form proper types), so maybe some special-casing needs to be done in the macro. Maybe you'd like to take a stab at trying to fix this?

@Zhen-hao
Copy link
Author

Zhen-hao commented Sep 6, 2023

@Zhen-hao no, I can't recall this being a "no-fix" issue :). Parameterless-enums are a bit special (as the cases don't form proper types), so maybe some special-casing needs to be done in the macro. Maybe you'd like to take a stab at trying to fix this?

Good to know that there are no inherent challenges on this issue. I can take a look at it this weekend. No guarantee that I will find a solution.

@Zhen-hao
Copy link
Author

I didn't get the time to work on it. Hopefully, I can look into it in October.

@adamw
Copy link
Member

adamw commented Sep 15, 2023

@Zhen-hao no worries, looking forward! :)

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

No branches or pull requests

2 participants