#15401 closed bug (duplicate)

Weird GHCi bug

Reported by: vagarenko Owned by:
Priority: normal Milestone: 8.6.1
Component: GHCi Version: 8.4.3
Keywords: TypedHoles Cc:
Operating System: Unknown/Multiple Architecture: x86_64 (amd64)
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #15007 Differential Rev(s):
Wiki Page:

Description

Take a look at this GHCi session:

$ ghci                                                                   
GHCi, version 8.4.3: http://www.haskell.org/ghc/  :? for help

type do {_}

Prelude> do {_}                                                          
                                                                         
<interactive>:1:5: error:                                                
    * Found hole: _ :: t                                                 
      Where: `t' is a rigid type variable bound by                       
               the inferred type of it :: t                              
               at <interactive>:1:1-6                                    
    * In a stmt of a 'do' block: _                                       
      In the expression: do _                                            
      In an equation for `it': it = do _                                 
    * Relevant bindings include it :: t (bound at <interactive>:1:1)     
      Valid substitutions include                                        
        undefined :: forall (a :: TYPE r).                               
                     GHC.Stack.Types.HasCallStack =>                     
                     a                                                   
          (imported from `Prelude' (and originally defined in `GHC.Err'))

looks ok

type ()

Prelude> ()                                              
()                                                            

ok

type do {_} again

Prelude> do {_}                                                          
                                                                         
<interactive>:3:5: error:                                                
    * Found hole: _ :: t                                                 
      Where: `t' is a rigid type variable bound by                       
               the inferred type of it :: t                              
               at <interactive>:3:1-6                                    
    * In a stmt of a 'do' block: _                                       
      In the expression: do _                                            
      In an equation for `it': it = do _                                 
    * Relevant bindings include it :: t (bound at <interactive>:3:1)     
      Valid substitutions include                                        
        undefined :: forall (a :: TYPE r).                               
                     GHC.Stack.Types.HasCallStack =>                     
                     a                                                   
          (imported from `Prelude' (and originally defined in `GHC.Err'))

ok, same message

type () second type

Prelude> ()                                              
()                                                            

ok,

type do {_} third time:

Prelude> do {_}                                                          
                                                                         
<interactive>:1:1: error:                                                
    GHC internal error: `Ghci1.it' is not in scope during type checking, 
but it passed the renamer                                                
    tcl_env of environment: []                                           
Prelude>                                                                 

what's happening?

Change History (1)

comment:1 Changed 14 months ago by RyanGlScott

Keywords: TypedHoles added
Resolution: duplicate
Status: newclosed

Thanks for the bug report. This is a duplicate of #15007, so I'll close this ticket in favor of that one.

Note: See TracTickets for help on using tickets.