Skip to content

Extra parens in error message's displayed code

I'm forwarding the bug #499137 from Debian's BTS.

With this example:

import System.Environment

main = do args <- filter (/= "--nofork") getArgs
          return ()

I get this error message:

    Couldn't match expected type `[[Char]]'
           against inferred type `IO [String]'
    In the second argument of `filter', namely `getArgs'
    In a 'do' expression: args <- filter ((/= "--nofork")) getArgs
    In the expression:
        do args <- filter ((/= "--nofork")) getArgs
           return ()

At some turn, the expression gained an extraneous pair of parenthesis.

Trac metadata
Trac field Value
Version 6.8.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information