{"record":{"id":"442827b0c80ff1b3","repo":"antlr/antlr4","slug":"delegates-442827","errorCode":null,"errorMessage":"delegates","messagePattern":"delegates","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"runtime/CSharp/src/ProxyErrorListener.cs","lineNumber":26,"sourceCode":"namespace Antlr4.Runtime\n{\n    /// <summary>\n    /// This implementation of\n    /// <see cref=\"IAntlrErrorListener{Symbol}\"/>\n    /// dispatches all calls to a\n    /// collection of delegate listeners. This reduces the effort required to support multiple\n    /// listeners.\n    /// </summary>\n    /// <author>Sam Harwell</author>\n    public class ProxyErrorListener<Symbol> : IAntlrErrorListener<Symbol>\n    {\n        private readonly IEnumerable<IAntlrErrorListener<Symbol>> delegates;\n\n        public ProxyErrorListener(IEnumerable<IAntlrErrorListener<Symbol>> delegates)\n        {\n            if (delegates == null)\n            {\n                throw new ArgumentNullException(\"delegates\");\n            }\n            this.delegates = delegates;\n        }\n\n        protected internal virtual IEnumerable<IAntlrErrorListener<Symbol>> Delegates\n        {\n            get\n            {\n                return delegates;\n            }\n        }\n\n        public virtual void SyntaxError(TextWriter output, IRecognizer recognizer, Symbol offendingSymbol, int line, int charPositionInLine, string msg, RecognitionException e)\n        {\n            foreach (IAntlrErrorListener<Symbol> listener in delegates)\n            {\n                listener.SyntaxError(output, recognizer, offendingSymbol, line, charPositionInLine, msg, e);\n            }","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/antlr/antlr4/blob/7d5770395bb7b02eb56e7c62662cb1d7c08f42a3/runtime/CSharp/src/ProxyErrorListener.cs#L8-L44","documentation":"Error \"delegates\" thrown in antlr/antlr4.","triggerScenarios":"ProxyErrorListener constructed with a null delegates array or null delegate element.","commonSituations":"Pass non-null IAntlrErrorListener instances to the ProxyErrorListener constructor.","solutions":["Pass a non-null delegates array to the ProxyErrorListener constructor.","If you have no listeners yet, use an empty array or add listeners via parser.AddErrorListener instead of a proxy."],"exampleFix":"var proxy = new ProxyErrorListener(new IAntlrErrorListener<IToken>[] { myListener });","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d5770395bb7b02eb56e7c62662cb1d7c08f42a3","analyzedAt":"2026-08-14T14:47:56.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}