Make DsMeta catch up with LastStmt (fix Trac #5235)
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 10 Jun 2011 18:52:53 +0000 (19:52 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Fri, 10 Jun 2011 18:52:53 +0000 (19:52 +0100)
The new monad comprehension stuff introduce LastStmt,
and DsMeta must convert that to TH syntax

compiler/deSugar/DsMeta.hs

index a4b47ee..a5cbdd3 100644 (file)
@@ -880,6 +880,10 @@ repSts (ExprStmt e _ _ _ : ss) =
       ; z <- repNoBindSt e2 
       ; (ss2,zs) <- repSts ss
       ; return (ss2, z : zs) }
+repSts [LastStmt e _] 
+  = do { e2 <- repLE e
+       ; z <- repNoBindSt e2
+       ; return ([], [z]) }
 repSts []    = return ([],[])
 repSts other = notHandled "Exotic statement" (ppr other)