magnolia icon indicating copy to clipboard operation
magnolia copied to clipboard

Annotaions that are attached to the enum elements are not visible

Open Zhen-hao opened this issue 2 years ago • 4 comments

While working on https://github.com/sksamuel/avro4s/pull/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?

Zhen-hao avatar Sep 03 '23 05:09 Zhen-hao

@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?

adamw avatar Sep 06 '23 14:09 adamw

@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 avatar Sep 06 '23 15:09 Zhen-hao

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

Zhen-hao avatar Sep 15 '23 09:09 Zhen-hao

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

adamw avatar Sep 15 '23 12:09 adamw