#5181: HEAD panics on mc17
--------------------------------+-------------------------------------------
  Reporter:  daniel.is.fischer  |          Owner:                  
      Type:  bug                |         Status:  closed          
  Priority:  normal             |      Milestone:                  
 Component:  Compiler           |        Version:  7.1             
Resolution:  fixed              |       Keywords:                  
  Testcase:                     |      Blockedby:                  
Difficulty:                     |             Os:  Unknown/Multiple
  Blocking:                     |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown       |  
--------------------------------+-------------------------------------------
Changes (by simonpj):

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


Comment:

 Fixed by
 {{{
 commit 6a1aab7737016aa714b2ffec2b5657a18fac0e42
 Author: Simon Peyton Jones <[email protected]>
 Date:   Mon May 9 16:45:12 2011 +0100

     Fix renaming of guards

     This was making mc17 fail.

 >---------------------------------------------------------------

  compiler/hsSyn/HsExpr.lhs  |   10 ++++++----
  compiler/rename/RnExpr.lhs |    2 ++
  2 files changed, 8 insertions(+), 4 deletions(-)

 diff --git a/compiler/hsSyn/HsExpr.lhs b/compiler/hsSyn/HsExpr.lhs index
 9c88783..dd33cae 100644
 --- a/compiler/hsSyn/HsExpr.lhs
 +++ b/compiler/hsSyn/HsExpr.lhs
 @@ -1274,10 +1274,12 @@ data HsStmtContext id  \begin{code}
 isListCompExpr :: HsStmtContext id -> Bool
  -- Uses syntax [ e | quals ]
 -isListCompExpr ListComp  = True
 -isListCompExpr PArrComp  = True
 -isListCompExpr MonadComp = True
 -isListCompExpr _         = False
 +isListCompExpr ListComp         = True
 +isListCompExpr PArrComp         = True
 +isListCompExpr MonadComp        = True
 +isListCompExpr (ParStmtCtxt c)   = isListCompExpr c
 +isListCompExpr (TransStmtCtxt c) = isListCompExpr c
 +isListCompExpr _                 = False

  isMonadCompExpr :: HsStmtContext id -> Bool
  isMonadCompExpr MonadComp            = True
 diff --git a/compiler/rename/RnExpr.lhs b/compiler/rename/RnExpr.lhs index
 46eef67..88e0462 100644
 --- a/compiler/rename/RnExpr.lhs
 +++ b/compiler/rename/RnExpr.lhs
 @@ -694,6 +694,8 @@ rnStmt ctxt (L loc (ExprStmt expr _ _ _)) thing_inside
                                then lookupStmtName ctxt guardMName
                               else return (noSyntaxExpr, emptyFVs)
                               -- Only list/parr/monad comprehensions use
 'guard'
 +                             -- Also for sub-stmts of same eg [ e |
 x<-xs, gd | blah ]
 +                             -- Here "gd" is a guard
         ; (thing, fvs3)    <- thing_inside []
         ; return (([L loc (ExprStmt expr' then_op guard_op
 placeHolderType)], thing),
                   fv_expr `plusFV` fvs1 `plusFV` fvs2 `plusFV` fvs3) }
 }}}

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to