Skip to content

Commit e7bd86c

Browse files
committed
fix: handle empty type_args in define-trait definition
1 parent 05280cd commit e7bd86c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clarity/src/vm/types/signatures.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,6 +1655,9 @@ impl TypeSignature {
16551655
epoch: StacksEpochId,
16561656
clarity_version: ClarityVersion,
16571657
) -> Result<BTreeMap<ClarityName, FunctionSignature>> {
1658+
if type_args.is_empty() {
1659+
return Err(CheckErrors::InvalidTypeDescription);
1660+
}
16581661
let mut trait_signature: BTreeMap<ClarityName, FunctionSignature> = BTreeMap::new();
16591662
let functions_types = type_args[0]
16601663
.match_list()

0 commit comments

Comments
 (0)