[GHC] #7461: Error messages about "do" statements contain false information

GHC ghc-devs at haskell.org
Wed May 10 00:02:49 UTC 2017


#7461: Error messages about "do" statements contain false information
-------------------------------------+-------------------------------------
        Reporter:  EyalLotem         |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:  8.0.2
       Component:  Compiler (Type    |              Version:  7.6.1
  checker)                           |
      Resolution:  fixed             |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by bgamari):

 * status:  new => closed
 * resolution:   => fixed
 * milestone:   => 8.0.2


Comment:

 GHC 8.0 produces,

 {{{
 hi.hs:2:3: error:
     • Couldn't match expected type ‘Char’ with actual type ‘IO Char’
     • In a stmt of a 'do' block: getLine
       In the second argument of ‘($)’, namely
         ‘do { getLine;
               return 'x' }’
       In the expression:
         putChar
         $ do { getLine;
                return 'x' }
 }}}

 Which seems quite reasonable.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7461#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list