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
There is an instance of ParseField for Word16 and I was expecting it to fail for an input of "65536" because it is out-of-range.
I was surprised to find out that "65536" parses as 0:
ghci> runParser $ parseField @Word16 "65536"
Right 0
I think parseField on bounded integral types should do the necessary range-checking. The parseField for Word16 currently uses decimal from attoparsec, which does not do range checking. This issue affects different bounded integral types, not just Word16.
There is an instance of
ParseField
forWord16
and I was expecting it to fail for an input of "65536" because it is out-of-range.I was surprised to find out that "65536" parses as 0:
I think
parseField
on bounded integral types should do the necessary range-checking. TheparseField
forWord16
currently usesdecimal
from attoparsec, which does not do range checking. This issue affects different bounded integral types, not justWord16
.Related attoparsec issue: haskell/attoparsec#211
The text was updated successfully, but these errors were encountered: