summaryrefslogtreecommitdiff
path: root/compiler/GHC
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC')
-rw-r--r--compiler/GHC/Tc/Gen/Expr.hs7
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/GHC/Tc/Gen/Expr.hs b/compiler/GHC/Tc/Gen/Expr.hs
index 083c7e68a2..b768df9e48 100644
--- a/compiler/GHC/Tc/Gen/Expr.hs
+++ b/compiler/GHC/Tc/Gen/Expr.hs
@@ -431,11 +431,8 @@ tcExpr (HsStatic fvs expr) res_ty
; mapM_ checkClosedInStaticForm $ nonDetEltsUniqSet fvs
-- Require the type of the argument to be Typeable.
- -- The evidence is not used, but asking the constraint ensures that
- -- the current implementation is as restrictive as future versions
- -- of the StaticPointers extension.
; typeableClass <- tcLookupClass typeableClassName
- ; _ <- emitWantedEvVar StaticOrigin $
+ ; typeable_ev <- emitWantedEvVar StaticOrigin $
mkTyConApp (classTyCon typeableClass)
[liftedTypeKind, expr_ty]
@@ -446,7 +443,7 @@ tcExpr (HsStatic fvs expr) res_ty
-- Wrap the static form with the 'fromStaticPtr' call.
; fromStaticPtr <- newMethodFromName StaticOrigin fromStaticPtrName
[p_ty]
- ; let wrap = mkWpTyApps [expr_ty]
+ ; let wrap = mkWpEvVarApps [typeable_ev] <.> mkWpTyApps [expr_ty]
; loc <- getSrcSpanM
; return $ mkHsWrapCo co $ HsApp noComments
(L (noAnnSrcSpan loc) $ mkHsWrap wrap fromStaticPtr)