Open Nicceboy opened 8 months ago
Huh, the first code should work.
Huh, the first code should work.
It seems to work when newtype style is used, for example
#[derive(AsnType, Debug, Decode, Encode, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
#[rasn(automatic_tags)]
pub struct ContributedExtensionBlocks<T: ContributedExtension>(
SequenceOf<ContributedExtensionBlock<T>>,
);
Edit, nevermind, it won't. The compiler error was just hidden by other errors.
It seems that syntax matters for declaring generics and trait declarations.
I have the following struct:
It does not compile, and if I expand
Encode
macro for example,CertExtType
condition is not carried.However, if I change syntax to following
Correct macro code is generated. I almost ended up writing custom functions, but noticed by accident. If someone else fights the same problem 😁 .