{"record":{"id":"88ede10c2309fb79","repo":"oven-sh/bun","slug":"finite-can-only-be-used-on-f64","errorCode":null,"errorMessage":"finite can only be used on f64","messagePattern":"finite can only be used on f64","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/codegen/bindgen-lib-internal.ts","lineNumber":541,"sourceCode":"  }\n\n  // Public interface definition API\n  get optional() {\n    if (this.flags.required) {\n      throw new Error(\"Cannot derive optional on a required type\");\n    }\n    if (this.flags.default) {\n      throw new Error(\"Cannot derive optional on a something with a default value (default implies optional)\");\n    }\n    return new TypeImpl(this.kind, this.data, {\n      ...this.flags,\n      optional: true,\n    });\n  }\n\n  get finite() {\n    if (this.kind !== \"f64\") {\n      throw new Error(\"finite can only be used on f64\");\n    }\n    if (this.flags.finite) {\n      throw new Error(\"This type already has finite set\");\n    }\n    return new TypeImpl(this.kind, this.data, {\n      ...this.flags,\n      finite: true,\n    });\n  }\n\n  get required() {\n    if (this.flags.required) {\n      throw new Error(\"This type already has required set\");\n    }\n    if (this.flags.required) {\n      throw new Error(\"Cannot derive required on an optional type\");\n    }\n    return new TypeImpl(this.kind, this.data, {","sourceCodeStart":523,"sourceCodeEnd":559,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/src/codegen/bindgen-lib-internal.ts#L523-L559","documentation":"Bindgen DSL guard: `.finite` was used on a type whose kind is not f64. Range/finite constraints only exist for double-precision floats in the C ABI layer, so applying it elsewhere is a definition error at codegen time.","triggerScenarios":"Thrown at src/codegen/bindgen-lib-internal.ts:541 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Change the argument type to f64 if a finite constraint is needed","Remove `.finite` for integer/other kinds — use validateInt32/enforceRange instead","Re-run codegen after correcting the type chain"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","contentChangedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}