[GHC] #14691: Replace EvTerm with CoreExpr

GHC ghc-devs at haskell.org
Mon Jan 22 16:03:02 UTC 2018


#14691: Replace EvTerm with CoreExpr
-------------------------------------+-------------------------------------
        Reporter:  nomeata           |                Owner:  (none)
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.3
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by nomeata):

 Ok, I made progress. `tcLookupId` is the right thing to use here, I just
 need to use it in the right place :-)

 Next problem:
 {{{
 libraries/base/GHC/Exception.hs:1:1: error:
     GHC internal error: ‘GHC.Exception.$tcArithException’ is not in scope
 during type checking, but it passed the renamer
 }}}

 I believe this is caused by the following
 {{{
 tyConRep :: TyCon -> TcS CoreExpr
 -- Returns CoreExpr :: TyCon
 tyConRep tc
   | Just tc_rep_nm <- tyConRepName_maybe tc
   = do { tc_rep_id <- tcLookupId tc_rep_nm
        ; return (Var tc_rep_id) }
   | otherwise
   = pprPanic "tyConRep" (ppr tc)
 }}}
 where the `tcLookupId` fails, because the type-checker does not know yet
 that `GHC.Exception.$tcArithException` exists (not sure if it exists at
 that time).

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


More information about the ghc-tickets mailing list