{"record":{"id":"beac0cda8b044176","repo":"oracle/graal","slug":"not-enough-inputs-for-descriptor-name","errorCode":null,"errorMessage":"not enough inputs for ${descriptor.name}","messagePattern":"not enough inputs for (.+?)","errorType":"validation","errorClass":"RuleParseError","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler.processor/src/jdk/graal/compiler/core/match/processor/MatchProcessor.java","lineNumber":169,"sourceCode":"\n        boolean done() {\n            return current == tokens.length;\n        }\n\n        private MatchDescriptor parseExpression() {\n            if (peek(\"(\").equals(\"(\")) {\n                next();\n                MatchDescriptor descriptor = parseType(true);\n                for (int n = 0; n < descriptor.nodeType.inputs.size(); n++) {\n                    if (peek(\"(\").equals(\"(\")) {\n                        descriptor.inputs[n] = parseExpression();\n                    } else {\n                        descriptor.inputs[n] = parseType(false);\n                    }\n                }\n                for (int n = 0; n < descriptor.nodeType.inputs.size(); n++) {\n                    if (descriptor.inputs[n] == null) {\n                        throw new RuleParseError(\"not enough inputs for \" + descriptor.name);\n                    }\n                }\n                if (peek(\")\").equals(\")\")) {\n                    next();\n                    return descriptor;\n                }\n                throw new RuleParseError(\"Too many arguments to \" + descriptor.nodeType.nodeClass);\n            }\n            throw new RuleParseError(\"Extra tokens following match pattern: \" + peek(null));\n        }\n\n        private MatchDescriptor parseType(boolean forExpression) {\n            TypeDescriptor type = null;\n            String name = null;\n            if (Character.isUpperCase(peek(\"node type or name\").charAt(0))) {\n                String token = next();\n                type = knownTypes.get(token);\n                if (type == null) {","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler.processor/src/jdk/graal/compiler/core/match/processor/MatchProcessor.java#L151-L187","documentation":"Thrown by RuleParser.parseExpression when a node type in a @MatchRule declares N inputs but fewer than N were supplied AND some input slot remained null after both the expression and parseType passes. Node types come from knownTypes built from @MatchableNode metadata, so the required arity is fixed by the node class; the pattern must fill every declared input.","triggerScenarios":"Writing @MatchRule(\"Add(x)\") when the Add node declares two inputs; omitting optional-but-listed inputs is not supported at the pattern level — every entry in nodeType.inputs must get a slot. The loop assigns descriptor.inputs[n] from either parseExpression or parseType, then null-checks all slots.","commonSituations":"Adding a new input to a @MatchableNode class and forgetting to update existing rules; writing rules from memory instead of the node's input list; porting a rule from an older Graal version where the node had fewer inputs.","solutions":["Open the node class named in the rule and count its declared inputs (fields/inputs in @MatchableNode metadata); supply one pattern element per input.","Use a captured name (lowercase identifier) or a wildcard-style type for inputs you do not care about, but do not omit them.","After changing a @MatchableNode's inputs, grep for @MatchRule strings referencing that node and update them all."],"exampleFix":"// before (Add has 2 inputs)\n@MatchRule(\"Add(x)\")\n\n// after\n@MatchRule(\"Add(x, y)\")","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"No runtime handling; the annotation processor fails the build. Grep build logs for 'not enough inputs' and cross-reference the node class's input count.","preventionTips":["Always fill every declared input of the node type in the pattern, using capture names for don't-care slots.","After changing a @MatchableNode's inputs, update every @MatchRule referencing it (grep the simple name).","Keep input lists of matchable nodes stable across refactors where possible."],"tags":["graalvm","match-rules","annotation-processing","arity","compile-time"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}