[commit: ghc] master: use Proxy instead of undefined -- we already dropped support for 7.6 (7aea0cf)
git at git.haskell.org
git at git.haskell.org
Sat Oct 24 10:04:35 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/7aea0cfa609c8750ad256f5b2a6583444a907bf6/ghc
>---------------------------------------------------------------
commit 7aea0cfa609c8750ad256f5b2a6583444a907bf6
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date: Sat Oct 24 12:05:41 2015 +0200
use Proxy instead of undefined -- we already dropped support for 7.6
Reviewers: austin, goldfire, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1363
>---------------------------------------------------------------
7aea0cfa609c8750ad256f5b2a6583444a907bf6
compiler/typecheck/TcSplice.hs | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs
index 12f28a5..728c40a 100644
--- a/compiler/typecheck/TcSplice.hs
+++ b/compiler/typecheck/TcSplice.hs
@@ -109,8 +109,9 @@ import GHC.Desugar ( AnnotationWrapper(..) )
import qualified Data.Map as Map
import Data.Dynamic ( fromDynamic, toDyn )
-import Data.Typeable ( typeOf, Typeable )
+import Data.Typeable ( typeOf, Typeable, typeRep )
import Data.Data (Data)
+import Data.Proxy ( Proxy (..) )
import GHC.Exts ( unsafeCoerce# )
#endif
@@ -844,9 +845,7 @@ instance TH.Quasi (IOEnv (Env TcGblEnv TcLclEnv)) where
th_state_var <- fmap tcg_th_state getGblEnv
th_state <- readTcRef th_state_var
-- See #10596 for why we use a scoped type variable here.
- -- ToDo: convert @undefined :: a@ to @proxy :: Proxy a@ when
- -- we drop support for GHC 7.6.
- return (Map.lookup (typeOf (undefined :: a)) th_state >>= fromDynamic)
+ return (Map.lookup (typeRep (Proxy :: Proxy a)) th_state >>= fromDynamic)
qPutQ x = do
th_state_var <- fmap tcg_th_state getGblEnv
More information about the ghc-commits
mailing list