{"record":{"id":"94389fab5c18266a","repo":"gleam-lang/gleam","slug":"this-is-an-extra-type-specifier","errorCode":null,"errorMessage":"This is an extra type specifier","messagePattern":"This is an extra type specifier","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler-core/src/bit_array.rs","lineNumber":135,"sourceCode":"                        target,\n                        option: UnsupportedOption::UtfCodepointPattern,\n                    },\n                    option.location(),\n                );\n            }\n\n            Bytes { .. }\n            | Int { .. }\n            | Float { .. }\n            | Bits { .. }\n            | Utf8 { .. }\n            | Utf16 { .. }\n            | Utf32 { .. }\n            | Utf8Codepoint { .. }\n            | Utf16Codepoint { .. }\n            | Utf32Codepoint { .. } => {\n                if let Some(previous) = categories.type_ {\n                    return err(\n                        ErrorType::ConflictingTypeOptions {\n                            existing_type: previous.label(),\n                        },\n                        option.location(),\n                    );\n                } else {\n                    categories.type_ = Some(option);\n                }\n            }\n\n            Signed { .. } | Unsigned { .. } => {\n                if let Some(previous) = categories.signed {\n                    return err(\n                        ErrorType::ConflictingSignednessOptions {\n                            existing_signed: previous.label(),\n                        },\n                        option.location(),\n                    );","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/gleam-lang/gleam/blob/15b07c783065c92bb016b1b74ed0995a5259850f/compiler-core/src/bit_array.rs#L117-L153","documentation":"Raised as ErrorType::ConflictingTypeOptions when a bit array segment specifies more than one type option (e.g. int, float, bytes, bits, utf8, utf16, utf32, or utf*_codepoint). A segment can have exactly one type; the second type option triggers this error at the location of the offending option.","triggerScenarios":"Writing two type specifiers on one segment, such as <<x:int:float>> or <<data:bytes:utf8>>, in either a bit array expression or a pattern.","commonSituations":"Typos where the author meant a size or unit option but wrote a second type; copy-paste edits that left a stale type option behind; misunderstanding that ':utf8' is a type, not a modifier.","solutions":["Remove the redundant type specifier, keeping only one type per segment","If you intended a sizing option, use 'size:n' or 'unit:n' instead of a second type","Merge intent into a single type that matches the data (e.g. choose bytes vs utf8, not both)"],"exampleFix":"// before\nlet assert <<header:32:float>> = data\n// after\nlet assert <<header:float>> = data","handlingStrategy":"validation","validationCode":"// Count type options before writing a segment: exactly one of\n// int | float | bytes | bits | utf8 | utf16 | utf32 | utf8_codepoint | utf16_codepoint | utf32_codepoint\nfn count_type_options(spec: String) -> Int {\n  [\"int\", \"float\", \"bytes\", \"bits\", \"utf8\", \"utf16\", \"utf32\"]\n  |> list.filter(fn(t) { string.contains(spec, \":\" <> t) })\n  |> list.length\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["One type option per segment — always verify after edits","Remember size/unit are modifiers, not types; use them instead of adding a second type","Let the compiler/linter read the segment aloud: type, then size, then unit, then signedness, then endianness"],"tags":["gleam","bit-array","conflicting-options"],"backgroundTag":"mutually-exclusive-options","analyzedSha":"15b07c783065c92bb016b1b74ed0995a5259850f","analyzedAt":"2026-09-14T11:14:59.388Z","contentChangedAt":"2026-09-14T11:14:59.388Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}