{"record":{"id":"aa720b06e186519a","repo":"windmill-labs/windmill","slug":"failed-to-find-inner-type-of-array-type","errorCode":null,"errorMessage":"Failed to find inner type of array type","messagePattern":"Failed to find inner type of array type","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/parsers/windmill-parser-csharp/src/lib.rs","lineNumber":128,"sourceCode":"                Ok(\"ushort\") | Ok(\"System.UInt16\") => Ok(Typ::Int),\n                Ok(\"int\") | Ok(\"System.Int32\") => Ok(Typ::Int),\n                Ok(\"uint\") | Ok(\"System.UInt32\") => Ok(Typ::Int),\n                Ok(\"long\") | Ok(\"System.Int64\") => Ok(Typ::Int),\n                Ok(\"ulong\") | Ok(\"System.UInt64\") => Ok(Typ::Int),\n                Ok(\"char\") | Ok(\"System.Char\") => Ok(Typ::Str(None)),\n                Ok(\"float\") | Ok(\"System.Single\") => Ok(Typ::Float),\n                Ok(\"double\") | Ok(\"System.Double\") => Ok(Typ::Float),\n                Ok(\"bool\") | Ok(\"System.Boolean\") => Ok(Typ::Bool),\n                Ok(\"decimal\") | Ok(\"System.Decimal\") => Ok(Typ::Float),\n                Ok(\"object\") => Ok(Typ::Object(ObjectType::new(None, Some(vec![])))), // TODO: Complete the object type\n                Ok(s) => Err(anyhow!(\"Unknown type `{s}`\")),\n                Err(e) => Err(anyhow!(\"Error getting type name: {}\", e)),\n            }\n        }\n        \"array_type\" => {\n            let new_typ_node = typ_node\n                .child_by_field_name(\"type\")\n                .ok_or(anyhow!(\"Failed to find inner type of array type\"))?;\n            Ok(Typ::List(Box::new(find_typ(new_typ_node, code)?)))\n        }\n        \"identifier\" => Ok(Typ::Unknown),\n        \"generic_name\" => Ok(Typ::Unknown),\n        \"pointer_type\" => Ok(Typ::Int),\n        \"nullable_type\" => {\n            let new_typ_node = typ_node\n                .child_by_field_name(\"type\")\n                .ok_or(anyhow!(\"Failed to find inner type of nullable_type\"))?;\n            Ok(find_typ(new_typ_node, code)?)\n        }\n        wc => Err(anyhow!(\n            \"Unexpected C# type node kind: {} for '{}'. This type is not handeled by Windmill, please open an issue if this seems to be an error\",\n            wc,\n            typ_node.utf8_text(code.as_bytes())?\n        )),\n    }\n}","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/parsers/windmill-parser-csharp/src/lib.rs#L110-L146","documentation":"When find_typ encounters an `array_type` AST node, it looks up the element type via child_by_field_name(\"type\"). If that child is missing — the parse tree has an array type without an inner type field — it errors with this message. This is a structural AST expectation failure, usually from unusual or malformed C# syntax rather than plain `T[]` declarations.","triggerScenarios":"parse_csharp_sig_meta on a Main signature whose parameter type produces an array_type node lacking the `type` field: malformed array declarations like `Main(int[])` without a name, or grammar-version differences that change field naming for array types.","commonSituations":"Hand-edited or truncated C# scripts; using a tree-sitter-c-sharp version whose AST field names differ from what the parser expects; generating signatures from partially written code.","solutions":["Fix the array parameter declaration to standard form, e.g. `static void Main(int[] values)`","Verify the tree-sitter-c-sharp crate version matches what windmill-parser-csharp was written for and pin it in Cargo.lock","Simplify the signature to a plain element-typed parameter if the array form keeps failing"],"exampleFix":"// before\nstatic void Main(int[])\n// after\nstatic void Main(int[] values)","handlingStrategy":"try-catch","validationCode":"// Pre-check: ensure every array parameter is written as `Type[] name`\nlet re = regex::Regex::new(r\"\\b\\w+\\[\\]\\s+\\w+\").unwrap();\n// a `[]` type with no following identifier in the Main signature must be fixed before parsing","typeGuard":null,"tryCatchPattern":"match parse_csharp_sig_meta(code) {\n    Ok(m) => m,\n    Err(e) if e.to_string().contains(\"Failed to find inner type of array type\") => {\n        bail!(\"malformed array parameter in Main signature — write `T[] name`\")\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Always declare array parameters in full `T[] paramName` form","Keep tree-sitter-c-sharp pinned to the version windmill-parser-csharp was built against","Never deploy half-edited signatures — run the parser locally first"],"tags":["csharp","ast","parser","array-type"],"backgroundTag":"malformed-ast-node","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}