{"record":{"id":"0a79b94709ee9d29","repo":"gleam-lang/gleam","slug":"errortype-conflictingsignednessoptions-existing-signed","errorCode":null,"errorMessage":"ErrorType::ConflictingSignednessOptions { existing_signed: previous.label() }","messagePattern":"ErrorType::ConflictingSignednessOptions (.+?)","errorType":"validation","errorClass":"ErrorType","httpStatus":null,"severity":"error","filePath":"compiler-core/src/bit_array.rs","lineNumber":148,"sourceCode":"            | 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                    );\n                } else {\n                    categories.signed = Some(option);\n                }\n            }\n\n            Native { .. } if target == Target::JavaScript => {\n                return err(\n                    ErrorType::OptionNotSupportedForTarget {\n                        target,\n                        option: UnsupportedOption::NativeEndianness,\n                    },\n                    option.location(),\n                );","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/gleam-lang/gleam/blob/15b07c783065c92bb016b1b74ed0995a5259850f/compiler-core/src/bit_array.rs#L130-L166","documentation":"ErrorType::ConflictingSignednessOptions is raised when a segment declares signedness more than once, e.g. both signed and unsigned options on the same bit array segment. previous.label() reports the signedness that was already given.","triggerScenarios":"A segment like <<n:signed-unsigned-size(8)>> or <<n:int:unsigned:signed>> in an expression or pattern; type_options detects categories.signed already set when a second Signed/Unsigned option appears.","commonSituations":"Hand-editing segment options and forgetting the original signedness; macro-like copy-paste of option lists; confusion between the option names signed/unsigned and the type.","solutions":["Delete the duplicate signed or unsigned option, keeping one","Decide the intended signedness for the segment and keep only that option","If the intent differed per use, split into two segments or two variables"],"exampleFix":"// before\n<<value:int:unsigned:signed>>\n// after\n<<value:int:unsigned>>","handlingStrategy":"validation","validationCode":"// A segment may contain `signed` or `unsigned`, never both\nfn has_conflicting_signedness(spec: String) -> Bool {\n  string.contains(spec, \"signed\") && string.contains(spec, \"unsigned\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick signedness once per numeric segment and stick to a convention","Watch out: 'unsigned' contains 'signed' as a substring — check word boundaries in text searches","Review the full option chain after any hand edit of a segment"],"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"}