You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a subclass of Parser, and I tried to use it inside a macro. It failed with compiler error "A generic class can't have static fields".
As you can see in #61, I was able to get my Parser subclass working inside a macro by fencing static public macro function parse(). However, I understand that this isn't the correct solution.
I suppose that a similar workaround that I can use for now is to copy all of the code except static public macro function parse() from Parser into a new class, and use that copy instead. However, I would prefer to use the real Parser so that I don't need to manually merge any changes that you make to hxparse in the future.
The text was updated successfully, but these errors were encountered:
Just in case it's relevant, my use-case is creating a custom parser for some kind of markup language. The idea is that I would use this parser in a macro to dynamically generate a TypeDefinition and call Context.defineType().
I created a subclass of
Parser
, and I tried to use it inside a macro. It failed with compiler error "A generic class can't have static fields".As you can see in #61, I was able to get my
Parser
subclass working inside a macro by fencingstatic public macro function parse()
. However, I understand that this isn't the correct solution.I suppose that a similar workaround that I can use for now is to copy all of the code except
static public macro function parse()
fromParser
into a new class, and use that copy instead. However, I would prefer to use the realParser
so that I don't need to manually merge any changes that you make to hxparse in the future.The text was updated successfully, but these errors were encountered: