Enable maxBound checks for OverloadedLists (Fixes #18172)
Consider the Literal [256] :: [Data.Word.Word8]
When the OverloadedLists
extension is not active, then the ol_ext
field
in the OverLitTc
record that is passed to the function getIntegralLit
contains the type Word8
. This is a simple type, and we can use its
type constructor immediately for the warnAboutOverflowedLiterals
function.
When the OverloadedLists
extension is active, then the ol_ext
field
contains the type family Item [Word8]
. The function nomaliseType
is used
to convert it to the needed type Word8
.
Edited by Roland Senn