possibly incorrect indentation or mismatched brackets
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.
Trac metadata
Trac field | Value |
---|---|
Version | 7.6.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | low |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |