Open
Description
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
.
Related attoparsec issue: haskell/attoparsec#211
Metadata
Metadata
Assignees
Labels
No labels