{"record":{"id":"0e9b41b1e3999bf4","repo":"diem/diem","slug":"unsupported-inhabitation-type","errorCode":null,"errorMessage":"Unsupported inhabitation. Type: {:#?}","messagePattern":"Unsupported inhabitation\\. Type: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"language/testing-infra/test-generation/src/bytecode_generator.rs","lineNumber":937,"sourceCode":"                    .iter()\n                    .flat_map(|field| {\n                        let field_sig_tok = &field.signature.0;\n                        let reified_field_sig_tok = substitute(field_sig_tok, instantiation);\n                        Self::inhabit_with_bytecode_seq(module, &reified_field_sig_tok)\n                    })\n                    .collect();\n                let instantiation_index = module.add_instantiation(instantiation.clone());\n                let struct_inst = StructDefInstantiation {\n                    def: StructDefinitionIndex(struct_def_idx as TableIndex),\n                    type_parameters: instantiation_index,\n                };\n                let si_idx = module.add_struct_instantiation(struct_inst);\n                bytecodes.push(Bytecode::PackGeneric(StructDefInstantiationIndex(\n                    si_idx.0 as TableIndex,\n                )));\n                bytecodes\n            }\n            _ => unimplemented!(\"Unsupported inhabitation. Type: {:#?}\", token),\n        }\n    }\n}\n","sourceCodeStart":919,"sourceCodeEnd":941,"githubUrl":"https://github.com/diem/diem/blob/fc4714a8ea273b6efe8b13dbce72ea60aad9a16c/language/testing-infra/test-generation/src/bytecode_generator.rs#L919-L941","documentation":"inhabit_with_bytecode_seq only knows how to inhabit a fixed set of SignatureToken kinds (primitives, structs, references, etc.). Any other token reaching the catch-all arm triggers unimplemented! with the token dumped, meaning the type oracle handed the generator a type it has no inhabitation strategy for.","triggerScenarios":"Calling inhabit_with_bytecode_seq with an unsupported SignatureToken — e.g. TypeVariable/uninstantiated generic parameters, vector of unsupported elements, signer, or a newly added token kind not yet covered by the match.","commonSituations":"Extending the Move language or the test generator with a new SignatureToken variant; running the generator on modules whose signatures contain type parameters that were never instantiated.","solutions":["Add a match arm implementing inhabitation for the reported token kind","Ensure all generic type parameters are instantiated with concrete types before calling inhabitation","Filter unsupported token kinds out of the type oracle's candidate set"],"exampleFix":"// before\n_ => unimplemented!(\"Unsupported inhabitation. Type: {:#?}\", token),\n// after\nSignatureToken::TypeVariable(_) => return None, // skip uninstantiated generics\n_ => unimplemented!(\"Unsupported inhabitation. Type: {:#?}\", token),\n","handlingStrategy":"type-guard","validationCode":"match token {\n    SignatureToken::Bool | SignatureToken::U8 | SignatureToken::U64 | SignatureToken::U128\n    | SignatureToken::Address | SignatureToken::Struct(_) | SignatureToken::Vector(_) => ok(),\n    _ => skip_unsupported(token),\n}","typeGuard":"fn is_supported_token(t: &SignatureToken) -> bool {\n    !matches!(t, SignatureToken::TypeVariable(_) | SignatureToken::Signer | SignatureToken::Reference(_))\n}","tryCatchPattern":null,"preventionTips":["Keep the supported-token list next to SignatureToken's definition so new variants force an update","Instantiate all generics before inhabitation","Cover inhabitation for every token kind in unit tests"],"tags":["rust","panic","test-generation","unimplemented"],"backgroundTag":"unsupported-type-inhabitation","analyzedSha":"fc4714a8ea273b6efe8b13dbce72ea60aad9a16c","analyzedAt":"2026-09-04T21:07:05.890Z","contentChangedAt":"2026-09-04T21:07:05.890Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}