Closed arg0d closed 1 year ago
The separate tests ensures that bytes
type is tested in isolation without Vec<u8
and u8
types being used in UDL. Testing reverse
itself is not necessary, just have to make sure the code compiles. I will move the comment from UDL file to test file.
Type::Bytes
produces incorrect code in the following situations:u8
is not referenced anywhere else in the definition file. This causes undefined symbolFfiConverterUint8
.Vec<u8>
is referenced somewhere in the definition file. This causes duplicate symbol definition forFfiConverterSequenceUint8
.To fix this, replace
Type::Bytes
withType::Sequence<u8>
in known types set before renderingType.cs
. This ensures that both FFI convertersFfiConverterSequenceUInt8
andFfiConverterUInt8
will be rendered exactly once inTypes.cs
.Fixes #49.