[GHC] #9327: possibly incorrect indentation or mismatched brackets

GHC ghc-devs at haskell.org
Fri Jul 18 00:06:53 UTC 2014


#9327: possibly incorrect indentation or mismatched brackets
-------------------------------------+-------------------------------------
        Reporter:  Jefffrey          |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  low               |               Milestone:
       Component:  Compiler          |                 Version:  7.6.3
        Keywords:                    |  Differential Revisions:
Operating System:  MacOS X           |            Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  warning at compile-time            |              Difficulty:  Unknown
       Test Case:                    |              Blocked By:
        Blocking:                    |         Related Tickets:
-------------------------------------+-------------------------------------
 I'm having a weird problem. This code compiles:


 {{{
 fetchSomething :: IO String
 fetchSomething = return "Something"

 main :: IO ()
 main = do
     if True
         then do
             l <- fetchSomething
             let fn s = do
                 let rs = s ++ ": "
                 l <- fetchSomething
                 return $ rs ++ l
             n <- fn "Prefix"
             putStr n
         else return ()
 }}}

 but the following doesn't:

 {{{
     let ep = Bridge.destination b </> e
     ed <- doesDirectoryExist ep
     if ed
         then do
             ds <- listDirs ep
             let fn p = do
                 let t = readUTC p
                 lt <- toLocalTime t               <-- parse error
 (possibly incorrect indentation or mismatched brackets)
                 return $ Snapshot t lt e b
             l <- mapM fn ds
             let r = sortBy (compare `on` time) l
             let ri = Prelude.take m $ assignIDs 1 r
             if o == Oldest
                 then return $ ri
                 else return $ reverse ri
         else return []
 }}}

 Here's a live demo of the former: http://coliru.stacked-
 crooked.com/a/0305f546c8566683

 To test the second, the only way I could find is by downloading this
 repository:
 https://github.com/Jefffrey/Kopia/commit/9ec9eb93183c4ceed6d324f7fc726584de02755c
 and running `cabal test`.

 Someone on the #haskell channel reproduced it on his machine too.

 This seems like a bug.

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


More information about the ghc-tickets mailing list