{"record":{"id":"826f02596d5b54c5","repo":"oracle/graal","slug":"unknown-node-type-token","errorCode":null,"errorMessage":"Unknown node type: ${token}","messagePattern":"Unknown node type: (.+?)","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":188,"sourceCode":"                    }\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) {\n                    throw new RuleParseError(\"Unknown node type: \" + token);\n                }\n                if (peek(\"=\").equals(\"=\")) {\n                    next();\n                    name = next();\n                }\n                originatingElements.addAll(type.originatingElements);\n            } else if (Character.isLowerCase(peek(\"name\").charAt(0))) {\n                name = next();\n                type = valueType;\n            } else {\n                throw new RuleParseError(\"Unexpected token \\\"%s\\\" when looking for name or node type\", peek(null));\n            }\n            requiredPackages.add(type.nodePackage);\n            if (name != null) {\n                if (!capturedNames.contains(name)) {\n                    capturedNames.add(name);\n                    capturedTypes.add(type);\n                } else {","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler.processor/src/jdk/graal/compiler/core/match/processor/MatchProcessor.java#L170-L206","documentation":"Thrown by RuleParser.parseType when a token starting with an uppercase letter is not found in knownTypes, the map of node types discovered from @MatchableNode-annotated classes during annotation processing. Uppercase-initial tokens are treated as node type names; lowercase ones are captured variable names. An unknown uppercase token therefore means the type was never registered as matchable (or is misspelled).","triggerScenarios":"Referencing a node class in @MatchRule that lacks @MatchableNode (or whose declaring class was not scanned in this compilation round), or a simple typo: \"add(x, y)\" vs \"Add(x, y)\", \"Ad(x, y)\". knownTypes.get(token) returning null triggers the error.","commonSituations":"Matching on a node type from another suite/package not annotated @MatchableNode; renaming a node class and missing a rule; case typos; using a type's fully-qualified name where the simple name is expected.","solutions":["Verify the exact simple name against the node class (case-sensitive).","Ensure the referenced node class is annotated with @MatchableNode so the processor registers it.","If the type lives in another package, check the processor's requiredPackages/scan configuration makes it visible in this compilation."],"exampleFix":"// before\n@MatchRule(\"add(x, y)\")  // typo, also parsed as name not type\n\n// after\n@MatchRule(\"Add(x, y)\")","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"Compile-time only. Tooling can map 'Unknown node type: X' to a search for class X and check whether it carries @MatchableNode.","preventionTips":["Only reference node classes annotated with @MatchableNode in rules.","Use the exact case-sensitive simple name of the node class.","After renaming a node class, update all @MatchRule strings."],"tags":["graalvm","match-rules","annotation-processing","unknown-type","compile-time"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}