Observe many tsc compile errors in the Parser file, indicating incompatible symbols (at first I thought this was a typescript strict issue, as the incompatibilty is with a type union that includes null)
As an antlr4 newbie, I was bit by the above this morning. I am guessing that this is because of a naming conflict with the getText method that the parser class inherits. I am not sure if this is something that antlr4ng should handle differently - perhaps it could output a warning or an error if a parser rule conflicts with a native method? At any rate, I wanted to document the gotcha in case anyone else ran into it and became confused, as I was. Feel free to resolve if no changes to antlr4ng are prudent.
The generated methods could use a unique name. Maybe a configurable prefix/postfix would help here? I'll take a note in the ANTLRng feature ideas list.
Steps to Reproduce:
getText
antlr4ng
As an antlr4 newbie, I was bit by the above this morning. I am guessing that this is because of a naming conflict with the
getText
method that the parser class inherits. I am not sure if this is something that antlr4ng should handle differently - perhaps it could output a warning or an error if a parser rule conflicts with a native method? At any rate, I wanted to document the gotcha in case anyone else ran into it and became confused, as I was. Feel free to resolve if no changes to antlr4ng are prudent.Thanks for the great tool!