You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a custom parser with more parameters than just the stream, binaryparse expects an encoder signature with only 2 parameters - the stream and the input. If you try to add more parameters it doesn't work. For example:
test.nim(12, 13) template/generic instantiation of `createParser` from here
binaryparse.nim(358, 15) Error: type mismatch: got <Stream, tuple[a: int]>
but expected one of:
proc (stream: Stream, input: var tuple[a: int], extra: int){.noSideEffect, gcsafe, locks: 0.}
The text was updated successfully, but these errors were encountered:
sealmove
changed the title
Custom encoder doesn't allow for extra parameters
Custom encoder does not support extra parameters
Dec 1, 2020
When creating a custom parser with more parameters than just the stream, binaryparse expects an encoder signature with only 2 parameters - the stream and the input. If you try to add more parameters it doesn't work. For example:
This errors with:
The text was updated successfully, but these errors were encountered: