I feel like this should be allowed. I'm rewriting some two year old code and 
wanted to move from an external code generator to using a macro. However, I 
can't tag the proper serialization values on to the enums due to this 
restriction.
    
    
    template id_key(value: int) {.pragma.}
    
    type
       MajorType* = enum
          mtPositiveInteger {.id_key: 0.}
          mtNegativeInteger {.id_key: 1.}
          mtBinaryString {.id_key: 2.}
          mtUnicodeString {.id_key: 3.}
          mtArray {.id_key: 4.}
          mtMap {.id_key: 5.}
          mtSemantic {.id_key: 6.}
          mtSpecial {.id_key: 7.}
    
    
    Run

I'll have to work around this either by bringing the code generator back, or 
working around it with a different kind of macro. But it's somewhat annoying 
that enum elements cannot be tagged in this way.

Reply via email to