{"record":{"id":"7d8248147619349b","repo":"xai-org/x-algorithm","slug":"col-d-unrecognized-type-s","errorCode":null,"errorMessage":"col %d: Unrecognized type: %s","messagePattern":"col (.+?): Unrecognized type: (.+?)","errorType":"exception","errorClass":"ParseFailure","httpStatus":null,"severity":"error","filePath":"botmaker/src/java/com/twitter/botmaker/compiler/types/TypeCompiler.java","lineNumber":49,"sourceCode":"  public static Type getType(\n      Tree tree,\n      TypeContext context\n  ) throws ParseFailure, SemanticCheckFailure {\n    if (tree.getType() == BotMakerLexer.GENERIC_TYPE) {\n      return getCompositeType(tree, context);\n    } else if (tree.getChildCount() > 1) {\n      String className = getFullClassName(tree);\n      return getTypeFromClassName(className);\n    } else {\n      String typeName = tree.getChild(0).getText();\n      Optional<Type> typeFromContextOpt = context.getTypeFromName(typeName);\n      Optional<Type> primitiveTypeOpt = getPrimitiveType(typeName);\n      if (typeFromContextOpt.isPresent()) {\n        return typeFromContextOpt.get();\n      } else if (primitiveTypeOpt.isPresent()) {\n        return primitiveTypeOpt.get();\n      } else {\n        throw new ParseFailure(String.format(\n            \"col %d: Unrecognized type: %s\",\n            tree.getCharPositionInLine() + 1, typeName));\n      }\n    }\n  }\n\n  private static String getFullClassName(Tree tree) {\n    StringBuilder builder = new StringBuilder();\n    builder.append(tree.getChild(0).getText());\n    for (int index = 1; index < tree.getChildCount(); index++) {\n      builder.append('.').append(tree.getChild(index).getText());\n    }\n    return builder.toString();\n  }\n\n  private static Type getCompositeType(\n      Tree tree,\n      TypeContext context","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/botmaker/src/java/com/twitter/botmaker/compiler/types/TypeCompiler.java#L31-L67","documentation":"TypeCompiler.getType resolves a simple (non-composite) type name from rule context or the primitive table. A name found in neither throws ParseFailure 'col N: Unrecognized type'.","triggerScenarios":"Compiling a botmaker rule whose type expression names an unknown simple type — e.g. 'u64' when only UINT64 is registered, or a class name where a type keyword is required.","commonSituations":"Typos in type names, custom types not registered in the TypeContext, dialect differences between botmaker rule versions.","solutions":["Use the exact registered primitive/composite type name (case-sensitive)","Register the custom type in the TypeContext before compiling","Check the reported column to find the offending token and fix the typo"],"exampleFix":"// before\n... : u64 ...\n// after\n... : UINT64 ...","handlingStrategy":"validation","validationCode":"Optional<Type> known = getPrimitiveType(name); // plus context lookup\nif (!known.isPresent() && !contextHas(name)) rejectRule();","typeGuard":null,"tryCatchPattern":"catch ParseFailure; use the reported column to point the author at the bad type token","preventionTips":["Maintain a list of valid type names in rule tooling","Case-sensitive linting of type expressions"],"tags":["parser","type-system","validation"],"backgroundTag":"unknown-type-name","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}