diff --git a/ghc/compiler/reader/ReadPrefix.lhs b/ghc/compiler/reader/ReadPrefix.lhs index 18ec5b610e6e022c366fb6adfabaf41a996097df..d16dc74ff068a839cdd7cf7b785ae8a85a76d066 100644 --- a/ghc/compiler/reader/ReadPrefix.lhs +++ b/ghc/compiler/reader/ReadPrefix.lhs @@ -512,8 +512,11 @@ wlkLiteral ulit as_integer s = readInteger (_UNPK_ s) #if __GLASGOW_HASKELL__ == 201 as_rational s = GHCbase.readRational__ (_UNPK_ s) -- non-std -#elif __GLASGOW_HASKELL__ >= 202 - as_rational s = case readRational (_UNPK_ s) of { [(a,_)] -> a } -- ToDo, use non-std readRational__ +#elif __GLASGOW_HASKELL__ == 202 + as_rational s = case readRational (_UNPK_ s) of { [(a,_)] -> a } +#elif __GLASGOW_HASKELL__ >= 203 + as_rational s = readRational__ (_UNPK_ s) -- use non-std readRational__ + -- to handle rationals with leading '-' #else as_rational s = _readRational (_UNPK_ s) -- non-std #endif