{"record":{"id":"928acf6fdc6d19af","repo":"stride3d/stride","slug":"exception-of-type-system-notimplementedexception-was-thrown-928acf","errorCode":null,"errorMessage":"Exception of type 'System.NotImplementedException' was thrown.","messagePattern":"Exception of type 'System\\.NotImplementedException' was thrown\\.","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/Parsers/ShaderParsers/ShaderParameters.cs","lineNumber":11,"sourceCode":"using System.Diagnostics.CodeAnalysis;\nusing Stride.Shaders.Parsing.SDSL.AST;\n\nnamespace Stride.Shaders.Parsing.SDSL;\n\n\npublic record struct ParameterParsers : IParser<ParameterListNode>\n{\n    public bool Match<TScanner>(ref TScanner scanner, ParseResult result, [MaybeNullWhen(false)] out ParameterListNode parsed, in ParseError? orError = null) where TScanner : struct, IScanner\n    {\n        throw new NotImplementedException();\n    }\n    public static bool Declarations<TScanner>(ref TScanner scanner, ParseResult result, [MaybeNullWhen(false)] out ShaderParameterDeclarations parsed, in ParseError? orError = null)\n        where TScanner : struct, IScanner\n        => new ParameterDeclarationsParser().Match(ref scanner, result, out parsed, in orError);\n    public static bool Values<TScanner>(ref TScanner scanner, ParseResult result, out ShaderExpressionList parsed, in ParseError? orError = null)\n        where TScanner : struct, IScanner\n        => new ParameterListParser().Match(ref scanner, result, out parsed, in orError);\n\n    public static bool GenericsList<TScanner>(ref TScanner scanner, ParseResult result, [MaybeNullWhen(false)] out ShaderExpressionList parsed, in ParseError? orError = null)\n        where TScanner : struct, IScanner\n        => new GenericsListParser().Match(ref scanner, result, out parsed, in orError);\n    public static bool GenericsValue<TScanner>(ref TScanner scanner, ParseResult result, [MaybeNullWhen(false)] out Expression parsed, in ParseError? orError = null)\n        where TScanner : struct, IScanner\n        => new GenericsValueParser().Match(ref scanner, result, out parsed, in orError);\n}\n\n\npublic record struct ParameterDeclarationsParser : IParser<ShaderParameterDeclarations>","sourceCodeStart":1,"sourceCodeEnd":29,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/Parsers/ShaderParsers/ShaderParameters.cs#L1-L29","documentation":"ParameterParsers.Match is a stub: the struct implements IParser<ParameterListNode> but its Match method immediately throws NotImplementedException. Any code path that routes shader-parameter parsing through this parser can never succeed — the feature is simply not implemented yet.","triggerScenarios":"Calling ParameterParsers.Match directly, or any composition that selects this parser for parsing a shader parameter list (e.g. parsing a pass/ shader signature that expects a ParameterListNode).","commonSituations":"Using an experimental/incomplete SDSL parser API where the parameter-list parser was scaffolded (record struct with delegating static helpers) but the main Match was never filled in.","solutions":["Use the implemented static helpers instead (ParameterParsers.Declarations / ParameterParsers.Values), which delegate to ParameterDeclarationsParser","Implement Match in ParameterParsers (likely by delegating to the same ParameterDeclarationsParser/expression-list parsers)","Avoid the unimplemented parser path until the library ships an implementation"],"exampleFix":"// before\npublic bool Match<TScanner>(...) => throw new NotImplementedException();\n// after\npublic bool Match<TScanner>(ref TScanner scanner, ParseResult result, [MaybeNullWhen(false)] out ParameterListNode parsed, in ParseError? orError = null)\n    where TScanner : struct, IScanner\n    => Declarations(ref scanner, result, out var decls, in orError) && Assign(decls, out parsed);","handlingStrategy":"fallback","validationCode":"var parserType = typeof(ParameterParsers);\nbool matchImplemented = parserType.GetMethod(\"Match\")!.GetMethodImpl(\"Match\", 0, BindingFlags.Public|BindingFlags.Instance, null, null) is { DeclaringType: var d } && !d.Name.Contains(\"NotImplemented\");","typeGuard":"bool CanParseParameters = false; // static fact: ParameterParsers.Match is a stub; never call it in current builds","tryCatchPattern":"try { ok = ParameterParsers.Match(ref scanner, result, out parsed, orError); }\ncatch (NotImplementedException) { ok = ParameterParsers.Declarations(ref scanner, result, out var decls, in orError); parsed = MapToListNode(decls); }","preventionTips":["Use ParameterParsers.Declarations/Values static helpers instead of Match","Check the library version/changelog before relying on ParameterListNode parsing","Wrap experimental parser calls so NotImplementedException falls back to implemented paths","Track upstream commits that implement ParameterParsers.Match before enabling the code path"],"tags":["shader","parser","sdsl","stub","not-implemented"],"backgroundTag":"method-not-implemented","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}