X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FhsSyn%2FConvert.lhs;h=d392be24e3973d88f79d5b38de17f927ee040470;hb=7998a24404ffa577a3c303e37e4cfe0baf846454;hp=91d1b903f5dfc1db7719b3dac5ecbb9e4b749335;hpb=b06d623b2e367a572de5daf06d6a0b12c2740471;p=ghc-hetmet.git diff --git a/compiler/hsSyn/Convert.lhs b/compiler/hsSyn/Convert.lhs index 91d1b90..d392be2 100644 --- a/compiler/hsSyn/Convert.lhs +++ b/compiler/hsSyn/Convert.lhs @@ -399,7 +399,8 @@ cvtInlineSpec :: Maybe TH.InlineSpec -> Hs.InlinePragma cvtInlineSpec Nothing = defaultInlinePragma cvtInlineSpec (Just (TH.InlineSpec inline conlike opt_activation)) - = InlinePragma { inl_act = opt_activation', inl_rule = matchinfo, inl_inline = inline } + = InlinePragma { inl_act = opt_activation', inl_rule = matchinfo + , inl_inline = inline, inl_sat = Nothing } where matchinfo = cvtRuleMatchInfo conlike opt_activation' = cvtActivation opt_activation @@ -588,11 +589,12 @@ cvtLit (WordPrimL w) = do { force w; return $ HsWordPrim w } cvtLit (FloatPrimL f) = do { force f; return $ HsFloatPrim f } cvtLit (DoublePrimL f) = do { force f; return $ HsDoublePrim f } cvtLit (CharL c) = do { force c; return $ HsChar c } -cvtLit (StringL s) - = do { let { s' = mkFastString s } - ; force s' - ; return $ HsString s' - } +cvtLit (StringL s) = do { let { s' = mkFastString s } + ; force s' + ; return $ HsString s' } +cvtLit (StringPrimL s) = do { let { s' = mkFastString s } + ; force s' + ; return $ HsStringPrim s' } cvtLit _ = panic "Convert.cvtLit: Unexpected literal" -- cvtLit should not be called on IntegerL, RationalL -- That precondition is established right here in @@ -640,7 +642,7 @@ cvtTvs tvs = mapM cvt_tv tvs cvt_tv :: TH.TyVarBndr -> CvtM (LHsTyVarBndr RdrName) cvt_tv (TH.PlainTV nm) = do { nm' <- tName nm - ; returnL $ UserTyVar nm' + ; returnL $ UserTyVar nm' placeHolderKind } cvt_tv (TH.KindedTV nm ki) = do { nm' <- tName nm @@ -843,14 +845,7 @@ isBuiltInOcc ctxt_ns occ mk_uniq_occ :: OccName.NameSpace -> String -> Int# -> OccName.OccName mk_uniq_occ ns occ uniq = OccName.mkOccName ns (occ ++ '[' : shows (mk_uniq uniq) "]") - -- The idea here is to make a name that - -- a) the user could not possibly write, and - -- b) cannot clash with another NameU - -- Previously I generated an Exact RdrName with mkInternalName. - -- This works fine for local binders, but does not work at all for - -- top-level binders, which must have External Names, since they are - -- rapidly baked into data constructors and the like. Baling out - -- and generating an unqualified RdrName here is the simple solution + -- See Note [Unique OccNames from Template Haskell] -- The packing and unpacking is rather turgid :-( mk_occ :: OccName.NameSpace -> String -> OccName.OccName @@ -871,3 +866,17 @@ mk_uniq :: Int# -> Unique mk_uniq u = mkUniqueGrimily (I# u) \end{code} +Note [Unique OccNames from Template Haskell] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The idea here is to make a name that + a) the user could not possibly write (it has a "[" + and letters or digits from the unique) + b) cannot clash with another NameU +Previously I generated an Exact RdrName with mkInternalName. This +works fine for local binders, but does not work at all for top-level +binders, which must have External Names, since they are rapidly baked +into data constructors and the like. Baling out and generating an +unqualified RdrName here is the simple solution + +See also Note [Suppressing uniques in OccNames] in OccName, which +suppresses the unique when opt_SuppressUniques is on.