Skip to content

Commit 346d475

Browse files
Merge pull request #193 from sumleo/fix/package-type-conversion
Fix FixedSizeList type losing size and Map todo panic
2 parents 1ac82c6 + 0f44dd5 commit 346d475

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

crates/wac-types/src/package.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -756,12 +756,15 @@ impl<'a> TypeConverter<'a> {
756756
let option = ty.map(|ty| self.component_val_type(ty)).transpose()?;
757757
ValueType::Defined(self.types.add_defined_type(DefinedType::Future(option)))
758758
}
759-
wasm::ComponentDefinedType::FixedSizeList(ty, _) => {
759+
wasm::ComponentDefinedType::FixedSizeList(ty, size) => {
760760
let ty = self.component_val_type(*ty)?;
761-
ValueType::Defined(self.types.add_defined_type(DefinedType::List(ty)))
761+
ValueType::Defined(
762+
self.types
763+
.add_defined_type(DefinedType::FixedSizeList(ty, *size)),
764+
)
762765
}
763766
wasmparser::component_types::ComponentDefinedType::Map(_, _) => {
764-
todo!("wasmparser::component_types::ComponentDefinedType::Map");
767+
bail!("ComponentDefinedType::Map is not yet supported");
765768
}
766769
};
767770

0 commit comments

Comments
 (0)