#1333: core lint failures in arrow tests
-------------------------+--------------------------------------------------
    Reporter:  igloo     |        Owner:                         
        Type:  bug       |       Status:  new                    
    Priority:  normal    |    Milestone:  6.8                    
   Component:  Compiler  |      Version:  6.7                    
    Severity:  normal    |   Resolution:                         
    Keywords:            |   Difficulty:  Unknown                
          Os:  Unknown   |     Testcase:  arrowrun001 arrowrun004
Architecture:  Unknown   |  
-------------------------+--------------------------------------------------
Comment (by simonpj):

 I think that arrowrun004 is another case of #1080, which Ross is looking
 at.

 However arrowrun001 is different. Its triggered by an interaction of
   * the tick-boxes added by Andy Gill's HPC coverage tool, which is always
 on for GHCi, because the tick-boxes are used for debugging too
   * the desugaring of Ross Paterson's arrow syntax

 If you go:
 {{{
 ghc  -dcore-lint -ddump-tc arrowrun001.hs --interactive
 }}}
 you'll get the dump below (interesting lines marked ***; some stuff
 elided).  The problem is that the HPC tool inserts a tick-box that says
 that `b_av8` is in scope, but the desugaring for the arrow-syntax has
 taken it out of scope.

 I propose to leave it to Andy and Ross to fight it out.

 Simon

 {{{
 ==================== Typechecker ====================
 ....     ....

       eval (If e1 e2 e3)
              = proc env -> do ~(Bl b) <- eval e1 -< env
                               if b then eval e2 -< env else eval e3 -< env
 ....     ....



 *** Core Lint Errors: in result of Desugar ***
 <no location info>:
     In the expression: {tick (main:Main, 38)}_dGx
                          @ (GHC.Base.Bool -> Main.Exp -> Main.Exp ->
 GHC.Prim.State# GHC.Prim.RealWorld)
                          b_av8
     b_av8 is out of scope
 *** Offending Program ***

 ....     ....

             Main.If e1_av2 e2_av3 e3_av4 ->
               __letrec {
 ....     ....
                 >>>_aBS
                   @ [(Main.Id, Main.Val a_awZ)]
                   @ [(Main.Id, Main.Val a_awZ)]
                   @ (Main.Val a_awZ)
                   (arr_aBR
                      @ [(Main.Id, Main.Val a_awZ)]
                      @ [(Main.Id, Main.Val a_awZ)]
                      (\ (env_av6 :: [(Main.Id, Main.Val a_awZ)]) ->
 env_av6))
                   (>>>_aBS
                      @ [(Main.Id, Main.Val a_awZ)]
                      @ ([(Main.Id, Main.Val a_awZ)], GHC.Base.Bool)
                      @ (Main.Val a_awZ)
                      (>>>_aBS
                         @ [(Main.Id, Main.Val a_awZ)]
                         @ ([(Main.Id, Main.Val a_awZ)], [(Main.Id,
 Main.Val a_awZ)])
                         @ ([(Main.Id, Main.Val a_awZ)], GHC.Base.Bool)
                         (arr_aBR
                            @ [(Main.Id, Main.Val a_awZ)]
                            @ ([(Main.Id, Main.Val a_awZ)], [(Main.Id,
 Main.Val a_awZ)])
                            (\ (ds_dGG :: [(Main.Id, Main.Val a_awZ)]) ->
                               let {
                                 env_av6 :: [(Main.Id, Main.Val a_awZ)]
                                 []
                                 env_av6 = ds_dGG
                               } in  (env_av6, env_av6)))
                         (>>>_aBS
                            @ ([(Main.Id, Main.Val a_awZ)], [(Main.Id,
 Main.Val a_awZ)])
                            @ (Main.Val a_awZ, [(Main.Id, Main.Val a_awZ)])
                            @ ([(Main.Id, Main.Val a_awZ)], GHC.Base.Bool)
                            (first_aBT
                               @ [(Main.Id, Main.Val a_awZ)]
                               @ (Main.Val a_awZ)
                               @ [(Main.Id, Main.Val a_awZ)]
                               (case {tick (main:Main, 34)}_dGD
                                       @ (Main.Exp -> GHC.Prim.State#
 GHC.Prim.RealWorld) e1_av2
                                of tick_dGE { __DEFAULT ->
                                >>>_aBS
                                  @ [(Main.Id, Main.Val a_awZ)]
                                  @ [(Main.Id, Main.Val a_awZ)]
                                  @ (Main.Val a_awZ)
                                  (arr_aBR
                                     @ [(Main.Id, Main.Val a_awZ)]
                                     @ [(Main.Id, Main.Val a_awZ)]
                                     (\ (ds_dGC :: [(Main.Id, Main.Val
 a_awZ)]) ->
                                        let {
                                          env_av6 :: [(Main.Id, Main.Val
 a_awZ)]
                                          []
                                          env_av6 = ds_dGC
                                        } in  env_av6))
                                  (case {tick (main:Main, 33)}_dGz
                                          @ (Main.Exp -> GHC.Prim.State#
 GHC.Prim.RealWorld) e1_av2
                                   of tick_dGA { __DEFAULT ->
                                   eval_aBI e1_av2
                                   })
                                }))
                            (arr_aBR
                               @ (Main.Val a_awZ, [(Main.Id, Main.Val
 a_awZ)])
                               @ ([(Main.Id, Main.Val a_awZ)],
 GHC.Base.Bool)
                               (\ (ds_dGO :: (Main.Val a_awZ, [(Main.Id,
 Main.Val a_awZ)])) ->
                                  case ds_dGO of ds_dGO { (ds_dGJ, ds_dGH)
 ->
                                  let {
                                    ds_dGK :: Main.Val a_awZ
                                    []
                                    ds_dGK = ds_dGJ } in
                                  let {
                                    ds_dGL :: ()
                                    []
                                    ds_dGL =
                                      GHC.Err.irrefutPatError @ ()
 "arrowrun001.hs:(21,21)-(24,21)|(Main.Bl b)" } in
                                  let {
                                    b_av8 :: GHC.Base.Bool
                                    []
 ***                                b_av8 =
                                      let {
                                        fail_dGM :: GHC.Base.Bool
                                        []
                                        fail_dGM = ds_dGL `cast` (CoUnsafe
 () GHC.Base.Bool :: () ~ GHC.Base.Bool)
                                      } in
                                        case ds_dGK of wild_B1 {
                                          __DEFAULT -> fail_dGM; Main.Bl
 b_av8 -> __letrec { } in  b_av8
                                        } } in
                                  let {
                                    env_av6 :: [(Main.Id, Main.Val a_awZ)]
                                    []
                                    env_av6 = ds_dGH
                                  } in  (env_av6, b_av8)
                                  }))))
                      (case {tick (main:Main, 38)}_dGx
                              @ (GHC.Base.Bool -> Main.Exp -> Main.Exp ->
 GHC.Prim.State# GHC.Prim.RealWorld)
 ***                          b_av8
                              e2_av3
                              e3_av4
                       of tick_dGy { __DEFAULT ->
                       >>>_aBS
                         @ ([(Main.Id, Main.Val a_awZ)], GHC.Base.Bool)
                         @ (Data.Either.Either [(Main.Id, Main.Val a_awZ)]
 [(Main.Id, Main.Val a_awZ)])
                         @ (Main.Val a_awZ)
                         (arr_aBR
                            @ ([(Main.Id, Main.Val a_awZ)], GHC.Base.Bool)
                            @ (Data.Either.Either [(Main.Id, Main.Val
 a_awZ)] [(Main.Id, Main.Val a_awZ)])
                            (\ (ds_dGw :: ([(Main.Id, Main.Val a_awZ)],
 GHC.Base.Bool)) ->
 ***                           case ds_dGw of ds_dGw { (env_av6, b_av8) ->
                               case case {tick (main:Main, 35)}_dGl @
 (GHC.Prim.State# GHC.Prim.RealWorld)
                                    of tick_dGm { __DEFAULT ->
                                    b_av8
                                    }
                               of wild_B1 {
                                 GHC.Base.False ->
                                   Data.Either.Right
                                     @ [(Main.Id, Main.Val a_awZ)] @
 [(Main.Id, Main.Val a_awZ)] env_av6;
                                 GHC.Base.True ->
                                   Data.Either.Left
                                     @ [(Main.Id, Main.Val a_awZ)] @
 [(Main.Id, Main.Val a_awZ)] env_av6
                               }
                               }))
 ...
 }}}

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