{"record":{"id":"92492bb95ddc8124","repo":"windmill-labs/windmill","slug":"unexpected-c-type-node-kind-for-this-ty","errorCode":null,"errorMessage":"Unexpected C# type node kind: {} for '{}'. This type is not handeled by Windmill, please open an issue if this seems to be an error","messagePattern":"Unexpected C# type node kind: (.+?) for '(.+?)'\\. This type is not handeled by Windmill, please open an issue if this seems to be an error","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/parsers/windmill-parser-csharp/src/lib.rs","lineNumber":140,"sourceCode":"                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}\n\nfn parse_csharp_typ<'a>(\n    param_node: Node<'a>,\n    code: &str,\n) -> anyhow::Result<(Option<String>, Typ, String)> {\n    let name = param_node\n        .child_by_field_name(\"name\")\n        .and_then(|n| n.utf8_text(code.as_bytes()).ok())\n        .unwrap_or(\"\");\n    let otyp_node = param_node.child_by_field_name(\"type\");\n    let otyp = otyp_node\n        .and_then(|n| n.utf8_text(code.as_bytes()).ok())","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/parsers/windmill-parser-csharp/src/lib.rs#L122-L158","documentation":"This is find_typ's catch-all: any C# type node kind not explicitly handled (e.g. tuple_type, function_pointer_type, ref_type) produces this error, telling the user the type is not handled by Windmill and to open an issue. It is an intentional unsupported-feature rejection, not a crash.","triggerScenarios":"parse_csharp_sig_meta on a Main signature whose parameter type compiles to an unhandled AST kind: tuple parameters `(int a, string b)`, function pointers, `ref`/`out`/`in` modifiers producing ref_type nodes, nested generic constructs the grammar kinds differently.","commonSituations":"Authors writing idiomatic modern C# (tuples, records, spans, function pointers) in a Windmill script; ref/out parameters on Main; copying library-style signatures into Windmill.","solutions":["Rewrite the parameter using a supported type: primitives, arrays of them, generic_name (maps to Unknown), or object","Replace tuple/ref/out parameters with a single object or array parameter and unpack inside the body","Remove `ref`/`out`/`in` modifiers from Main parameters","Open a Windmill issue if the type seems like it should be supported, as the message requests"],"exampleFix":"// before\nstatic void Main((int Id, string Name) item)\n// after\nstatic void Main(object item) // pass as object/JSON and unpack in body","handlingStrategy":"type-guard","validationCode":"// Restrict signature parameter types to constructs the parser handles:\n// predefined primitives, identifier, generic_name, array_type, pointer_type, nullable_type.\n// Anything else (tuples, ref/out, function pointers) must be rewritten before deploy.","typeGuard":"fn signature_node_kind_supported(kind: &str) -> bool {\n    matches!(kind,\n        \"predefined_type\" | \"identifier\" | \"generic_name\" | \"array_type\"\n        | \"pointer_type\" | \"nullable_type\")\n}","tryCatchPattern":"match parse_csharp_signature(code) {\n    Ok(sig) => sig,\n    Err(e) if e.to_string().contains(\"Unexpected C# type node kind\") => {\n        // surface which kind failed so the author can rewrite the parameter\n        bail!(\"rewrite main-signature parameter: {e}\")\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Avoid tuples, ref/out/in modifiers, and function pointers in Windmill C# main signatures","Use object or generic (Typ::Unknown) parameters for rich data and unpack in the body","Keep signatures minimal; move complex type handling into the script body","Follow the error's own advice: open a Windmill issue for types that should be supported"],"tags":["csharp","unsupported-type","parser"],"backgroundTag":"unsupported-type-signature","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}