X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FdeSugar%2FDsMeta.hs;h=296766bb1759326a067fe27fe29610c676547ad8;hb=37f7228038a8228e1c33c4eaa3c19cab840ad051;hp=3d2450b2c36ba26bec1e2ade2a153fe02b11bd7b;hpb=fe37fd971c65d8298dcd031d936be13acad2a004;p=ghc-hetmet.git diff --git a/ghc/compiler/deSugar/DsMeta.hs b/ghc/compiler/deSugar/DsMeta.hs index 3d2450b..296766b 100644 --- a/ghc/compiler/deSugar/DsMeta.hs +++ b/ghc/compiler/deSugar/DsMeta.hs @@ -85,12 +85,20 @@ dsReify :: HsReify Id -> DsM CoreExpr -- Returns a CoreExpr of type reifyType --> M.Typ -- reifyDecl --> M.Dec -- reifyFixty --> M.Fix -dsReify (ReifyOut ReifyType (AnId id)) - = do { MkC e <- repTy (toHsType (idType id)) ; - return e } +dsReify (ReifyOut ReifyType name) + = do { thing <- dsLookupGlobal name ; + -- By deferring the lookup until now (rather than doing it + -- in the type checker) we ensure that all zonking has + -- been done. + case thing of + AnId id -> do { MkC e <- repTy (toHsType (idType id)) ; + return e } + other -> pprPanic "dsReify: reifyType" (ppr name) + } -dsReify r@(ReifyOut ReifyDecl thing) - = do { mb_d <- repTyClD (ifaceTyThing thing) ; +dsReify r@(ReifyOut ReifyDecl name) + = do { thing <- dsLookupGlobal name ; + mb_d <- repTyClD (ifaceTyThing thing) ; case mb_d of Just (MkC d) -> return d Nothing -> pprPanic "dsReify" (ppr r)