{"record":{"id":"c896039d80e2819d","repo":"GraphiteEditor/Graphite","slug":"invalid-implementations-for-argument","errorCode":null,"errorMessage":"Invalid #[implementations(...)] for argument `{}`.\nExpected a comma-separated list of `InputType -> OutputType` pairs.\nExample: #[implementations(i32 -> f64, String -> Vec<u8>)]\nError: {}","messagePattern":"Invalid #\\[implementations\\(\\.\\.\\.\\)\\] for argument `(.+?)`\\.\nExpected a comma-separated list of `InputType -> OutputType` pairs\\.\nExample: #\\[implementations\\(i32 -> f64, String -> Vec<u8>\\)\\]\nError: (.+?)","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"node-graph/node-macro/src/parsing.rs","lineNumber":745,"sourceCode":"\t}\n\n\tfeatures\n}\n\nfn parse_implementations(attr: &Attribute, name: &Ident) -> syn::Result<Punctuated<Type, Comma>> {\n\tlet content: TokenStream2 = attr.parse_args()?;\n\tlet parser = Punctuated::<Type, Comma>::parse_terminated;\n\tparser.parse2(content.clone()).map_err(|e| {\n\t\tlet span = e.span(); // Get the span of the error\n\t\tError::new(span, format!(\"Failed to parse implementations for argument '{name}': {e}\"))\n\t})\n}\n\nfn parse_node_implementations<T: Parse>(attr: &Attribute, name: &Ident) -> syn::Result<Punctuated<T, Comma>> {\n\tlet content: TokenStream2 = attr.parse_args()?;\n\tlet parser = Punctuated::<T, Comma>::parse_terminated;\n\tparser.parse2(content.clone()).map_err(|e| {\n\t\tError::new(\n\t\t\te.span(),\n\t\t\tformatdoc!(\n\t\t\t\t\"Invalid #[implementations(...)] for argument `{}`.\n\t\t\t\tExpected a comma-separated list of `InputType -> OutputType` pairs.\n\t\t\t\tExample: #[implementations(i32 -> f64, String -> Vec<u8>)]\n\t\t\t\tError: {}\",\n\t\t\t\tname,\n\t\t\t\te\n\t\t\t),\n\t\t)\n\t})\n}\n\nfn parse_field(pat_ident: PatIdent, ty: Type, attrs: &[Attribute]) -> syn::Result<ParsedField> {\n\tlet ident = &pat_ident.ident;\n\n\t// Checks for the #[data] attribute, indicating that this is a data field rather than an input parameter to the node.\n\t// Data fields act as internal state, using interior mutability to cache data between node evaluations.","sourceCodeStart":727,"sourceCodeEnd":763,"githubUrl":"https://github.com/GraphiteEditor/Graphite/blob/c507b356453361e31638b8bff8f6d46b6da2961e/node-graph/node-macro/src/parsing.rs#L727-L763","documentation":"The node-graph counterpart: parse_node_implementations requires each entry of #[implementations(...)] on a node parameter to be an `InputType -> OutputType` pair. This error fires when an entry is a bare type or otherwise malformed, and the message includes the argument name plus a full correct example.","triggerScenarios":"#[implementations(f64)] (missing -> OutputType); #[implementations(f64 -> )] (empty output); stray commas or mismatched brackets splitting one entry into invalid pieces.","commonSituations":"Assuming the older bare-type implementations grammar still works on node parameters; partial edits that leave one entry of a long list incomplete after a rename or type change.","solutions":["Rewrite every entry as a pair following the embedded example: #[implementations(i32 -> f64, String -> Vec<u8>)]","Scan the entire list — a single malformed entry fails the whole attribute","Make sure both sides of each pair are in-scope types (imports visible at the definition site)"],"exampleFix":"// before\n#[implementations(f64)]\n\n// after\n#[implementations(i32 -> f64, String -> Vec<u8>)]","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Every entry on a node parameter must be a complete InputType -> OutputType pair","Review the whole list after type renames — one stale entry fails the attribute","Keep the example from the error message open while authoring new lists"],"tags":["proc-macro","rust","node-graph","compile-time"],"backgroundTag":"proc-macro-syntax-error","analyzedSha":"c507b356453361e31638b8bff8f6d46b6da2961e","analyzedAt":"2026-08-16T21:57:18.596Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}