{"record":{"id":"748d527187cc896a","repo":"biomejs/biome","slug":"promiseconstructor-type-parameters-are-not-supported","errorCode":null,"errorMessage":"PromiseConstructor type parameters are not supported","messagePattern":"PromiseConstructor type parameters are not supported","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/codegen/src/generate_global_types/lower.rs","lineNumber":890,"sourceCode":"            | DeclarationKind::ImportEquals => {\n                bail!(\"value-side PromiseConstructor declarations are not supported\")\n            }\n        }\n\n        let declaration = source_cache\n            .find_interface_declaration(record)?\n            .with_context(|| {\n                format!(\n                    \"failed to find interface declaration {} at {:?}\",\n                    record.declared_name.text(),\n                    record.text_range\n                )\n            })?;\n        if declaration.extends_clause().is_some() {\n            bail!(\"PromiseConstructor extends clauses are not supported\");\n        }\n        if declaration.type_parameters().is_some() {\n            bail!(\"PromiseConstructor type parameters are not supported\");\n        }\n\n        validate_promise_methods(\n            &declaration,\n            PromiseMemberLocation::Static,\n            &mut saw_methods,\n        )?;\n        for member in declaration.members() {\n            if let AnyTsTypeMember::TsConstructSignatureTypeMember(member) = member {\n                validate_promise_construct_signature(&member)?;\n                saw_construct_signature = true;\n            }\n        }\n    }\n    if !saw_constructor_interface {\n        bail!(\"PromiseConstructor must include an interface declaration\");\n    }\n    if !saw_construct_signature {","sourceCodeStart":872,"sourceCodeEnd":908,"githubUrl":"https://github.com/biomejs/biome/blob/3835945f0638c88162351318b7bc8b64c5f2fba7/xtask/codegen/src/generate_global_types/lower.rs#L872-L908","documentation":"PromiseConstructor must be declared with no generic type parameters; the lowering hardcodes the single `<T>` used by the synthesized constructor. A declaration like `interface PromiseConstructor<T>` violates this assumption and triggers this error.","triggerScenarios":"Running codegen when the merged PromiseConstructor interface declares its own type parameters (e.g. `interface PromiseConstructor<T = any>`).","commonSituations":"Lib snapshots rewritten to parameterize the constructor interface; automated refactors of the bundled .d.ts files.","solutions":["Remove the type parameter list from interface PromiseConstructor in the lib sources","Extend single_type_parameter handling to the constructor path if parameterization is intended","Pin lib sources to a version without type parameters on PromiseConstructor"],"exampleFix":"// before\ninterface PromiseConstructor<T = any> { new <R>(...): Promise<R>; }\n// after\ninterface PromiseConstructor { new <R>(...): Promise<R>; }","handlingStrategy":"validation","validationCode":"if (promiseConstructorDecl.typeParameters?.length) {\n  throw new Error(\"interface PromiseConstructor must not declare type parameters\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep PromiseConstructor unconstrained; generics belong on its `new` signature","Check type-parameter lists during snapshot review","Codemod lib edits that add type parameters to global constructor interfaces"],"tags":["codegen","build-time","generics"],"backgroundTag":"unsupported-operation","analyzedSha":"3835945f0638c88162351318b7bc8b64c5f2fba7","analyzedAt":"2026-09-13T15:11:16.919Z","contentChangedAt":"2026-09-13T15:11:16.919Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}