From d15525f3b2110d1c2f41f27bba1cf4f3dd46e446 Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Mon, 11 May 2020 10:17:02 +0200 Subject: [PATCH] Fix after `type Uniq = Integer` patch Previous patch made `type Uniq = Integer` (instead of `Int`). This fixes the build --- compiler/hsSyn/Convert.hs | 4 ++-- compiler/typecheck/TcSplice.hs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/hsSyn/Convert.hs b/compiler/hsSyn/Convert.hs index 3853f6a013af..a92a7d362e49 100644 --- a/compiler/hsSyn/Convert.hs +++ b/compiler/hsSyn/Convert.hs @@ -1811,8 +1811,8 @@ thRdrName loc ctxt_ns th_occ th_name = case th_name of TH.NameG th_ns pkg mod -> thOrigRdrName th_occ th_ns pkg mod TH.NameQ mod -> (mkRdrQual $! mk_mod mod) $! occ - TH.NameL uniq -> nameRdrName $! (((Name.mkInternalName $! mk_uniq (fromInteger uniq)) $! occ) loc) - TH.NameU uniq -> nameRdrName $! (((Name.mkSystemNameAt $! mk_uniq (fromInteger uniq)) $! occ) loc) + TH.NameL uniq -> nameRdrName $! (((Name.mkInternalName $! mk_uniq (fromIntegral uniq)) $! occ) loc) + TH.NameU uniq -> nameRdrName $! (((Name.mkSystemNameAt $! mk_uniq (fromIntegral uniq)) $! occ) loc) TH.NameS | Just name <- isBuiltInOcc_maybe occ -> nameRdrName $! name | otherwise -> mkRdrUnqual $! occ -- We check for built-in syntax here, because the TH diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs index ec2ebb1b3e1c..25c387b7317c 100644 --- a/compiler/typecheck/TcSplice.hs +++ b/compiler/typecheck/TcSplice.hs @@ -920,7 +920,7 @@ To call runQ in the Tc monad, we need to make TcM an instance of Quasi: instance TH.Quasi TcM where qNewName s = do { u <- newUnique ; let i = toInteger (getKey u) - ; return (TH.mkNameU s i) } + ; return (TH.mkNameU s (fromIntegral i)) } -- 'msg' is forced to ensure exceptions don't escape, -- see Note [Exceptions in TH] @@ -2037,7 +2037,7 @@ reifyName :: NamedThing n => n -> TH.Name reifyName thing | isExternalName name = mk_varg pkg_str mod_str occ_str - | otherwise = TH.mkNameU occ_str (toInteger $ getKey (getUnique name)) + | otherwise = TH.mkNameU occ_str (fromIntegral $ getKey (getUnique name)) -- Many of the things we reify have local bindings, and -- NameL's aren't supposed to appear in binding positions, so -- we use NameU. When/if we start to reify nested things, that