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
Brand new sum codecs made by @m-bock make writing sum type codecs a breeze. But there is a problem with decoding error reports that in most cases happen to be are irrelevant.
the error reported is: (Named "Sample" (TypeMismatch "Expecting tag Baz, got Bar")). However, one would expect to see something like this: (Named "Sample" (Named "case Bar" (TypeMismatch "Int")))
This is because it currently propagates decoding errors for all cases (without respect to the actual tag value) and reports the error for the last case.
To solve this I refactored the code a bit and added tests for error reporting, going to make a PR.
The text was updated successfully, but these errors were encountered:
wclr
linked a pull request
Dec 29, 2024
that will
close
this issue
Brand new sum codecs made by @m-bock make writing sum type codecs a breeze. But there is a problem with decoding error reports that in most cases happen to be are irrelevant.
For example, for this type
When parsing (wrong value type):
the error reported is:
(Named "Sample" (TypeMismatch "Expecting tag Baz, got Bar"))
. However, one would expect to see something like this:(Named "Sample" (Named "case Bar" (TypeMismatch "Int")))
This is because it currently propagates decoding errors for all cases (without respect to the actual tag value) and reports the error for the last case.
To solve this I refactored the code a bit and added tests for error reporting, going to make a PR.
The text was updated successfully, but these errors were encountered: