{"record":{"id":"b746e914b7b26891","repo":"oven-sh/bun","slug":"t-type-kind-can-only-be-used-as-a-function-argu","errorCode":null,"errorMessage":"t.${type.kind} can only be used as a function argument type","messagePattern":"t\\.(.+?) can only be used as a function argument type","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/codegen/bindgen-lib-internal.ts","lineNumber":669,"sourceCode":"}\n\nexport function inspect(value: any) {\n  return Bun.inspect(value, { colors: Bun.enableANSIColors });\n}\n\nexport function oneOfImpl(types: TypeImpl[]): TypeImpl {\n  const out: TypeImpl[] = [];\n  for (const type of types) {\n    if (type.kind === \"oneOf\") {\n      out.push(...type.data);\n    } else {\n      if (type.flags.default) {\n        throw new Error(\n          \"Union type cannot include a default value. Instead, set a default value on the union type itself\",\n        );\n      }\n      if (type.isVirtualArgument()) {\n        throw new Error(`t.${type.kind} can only be used as a function argument type`);\n      }\n      out.push(type);\n    }\n  }\n  return new TypeImpl(\"oneOf\", out);\n}\n\nexport function dictionaryImpl(record: Record<string, TypeImpl>): TypeImpl {\n  const out: DictionaryField[] = [];\n  for (const key in record) {\n    const type = record[key];\n    if (type.isVirtualArgument()) {\n      throw new Error(`t.${type.kind} can only be used as a function argument type`);\n    }\n    out.push({\n      key,\n      type: type,\n    });","sourceCodeStart":651,"sourceCodeEnd":687,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/src/codegen/bindgen-lib-internal.ts#L651-L687","documentation":"Error \"t.${type.kind} can only be used as a function argument type\" thrown in oven-sh/bun.","triggerScenarios":"Thrown at src/codegen/bindgen-lib-internal.ts:669 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}