#1662: mistranslation of arrow notation
-------------------------+--------------------------------------------------
    Reporter:  ross      |        Owner:             
        Type:  bug       |       Status:  new        
    Priority:  normal    |    Milestone:             
   Component:  Compiler  |      Version:  6.6.1      
    Severity:  normal    |   Resolution:             
    Keywords:            |   Difficulty:  Unknown    
          Os:  Unknown   |     Testcase:  arrowrun004
Architecture:  Unknown   |  
-------------------------+--------------------------------------------------
Comment (by ross):

 The source program
 {{{
 expr = proc () -> do
         x <- term -< ()
         expr' -< x
 }}}
 is translated by the type checker to (simplified a bit):
 {{{
 expr = proc
   (){(w) d 70} { arr{v aEB} [lid] = arr{v 01V} [gid]
                                         @ (<nt>BTParser{tc rdM} ESym{tc
 rdD})
                                         $dArrow{v aEE} [lid]
                  $dArrow{v aEE} [lid] = $f4{v rqS} [lid] @ ESym{tc rdD}
                  >>>{v aEC} [lid] = (>>>{v 01W} [gid])
                                         @ (<nt>BTParser{tc rdM} ESym{tc
 rdD})
                                         $dArrow{v aEF} [lid]
                  $dArrow{v aEF} [lid] = $dArrow{v aEE} [lid]
                  first{v aED} [lid] = first{v 01X} [gid]
                                         @ (<nt>BTParser{tc rdM} ESym{tc
 rdD})
                                         $dArrow{v aEG} [lid]
                  $dArrow{v aEG} [lid] = $dArrow{v aEE} [lid] }
   ->
   do ((x{v aeB} [lid] :: Int{(w) tc 3J})) <-
                 term{v rdq} [lid] -< (){(w) v 71} [gid]
      expr'{v rdo} [lid] -< x{v aeB} [lid]
 }}}
 These bindings ought not to be attached to the pattern of `proc`, because
 the scope of ''pat'' in `proc` ''pat'' `->` ''cmd'' is not the whole of
 ''cmd'' but only the subexpressions that are fed into arrows.  The
 bindings should be placed outside the `proc` expression, so that they
 scope over the whole thing.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1662>
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