diff options
Diffstat (limited to 'compiler/GHC/Hs/Lit.hs')
-rw-r--r-- | compiler/GHC/Hs/Lit.hs | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/compiler/GHC/Hs/Lit.hs b/compiler/GHC/Hs/Lit.hs index c92f13392d..a023755ffc 100644 --- a/compiler/GHC/Hs/Lit.hs +++ b/compiler/GHC/Hs/Lit.hs @@ -10,8 +10,8 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE UndecidableInstances #-} -- Note [Pass sensitive types] - -- in module GHC.Hs.PlaceHolder +{-# LANGUAGE UndecidableInstances #-} -- Wrinkle in Note [Trees That Grow] + -- in module GHC.Hs.Extension {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE TypeFamilies #-} @@ -151,23 +151,22 @@ overLitType :: HsOverLit GhcTc -> Type overLitType (OverLit (OverLitTc _ ty) _ _) = ty overLitType (XOverLit nec) = noExtCon nec --- | Convert a literal from one index type to another, updating the annotations --- according to the relevant 'Convertable' instance -convertLit :: (ConvertIdX a b) => HsLit a -> HsLit b -convertLit (HsChar a x) = HsChar (convert a) x -convertLit (HsCharPrim a x) = HsCharPrim (convert a) x -convertLit (HsString a x) = HsString (convert a) x -convertLit (HsStringPrim a x) = HsStringPrim (convert a) x -convertLit (HsInt a x) = HsInt (convert a) x -convertLit (HsIntPrim a x) = HsIntPrim (convert a) x -convertLit (HsWordPrim a x) = HsWordPrim (convert a) x -convertLit (HsInt64Prim a x) = HsInt64Prim (convert a) x -convertLit (HsWord64Prim a x) = HsWord64Prim (convert a) x -convertLit (HsInteger a x b) = HsInteger (convert a) x b -convertLit (HsRat a x b) = HsRat (convert a) x b -convertLit (HsFloatPrim a x) = HsFloatPrim (convert a) x -convertLit (HsDoublePrim a x) = HsDoublePrim (convert a) x -convertLit (XLit a) = XLit (convert a) +-- | Convert a literal from one index type to another +convertLit :: HsLit (GhcPass p1) -> HsLit (GhcPass p2) +convertLit (HsChar a x) = HsChar a x +convertLit (HsCharPrim a x) = HsCharPrim a x +convertLit (HsString a x) = HsString a x +convertLit (HsStringPrim a x) = HsStringPrim a x +convertLit (HsInt a x) = HsInt a x +convertLit (HsIntPrim a x) = HsIntPrim a x +convertLit (HsWordPrim a x) = HsWordPrim a x +convertLit (HsInt64Prim a x) = HsInt64Prim a x +convertLit (HsWord64Prim a x) = HsWord64Prim a x +convertLit (HsInteger a x b) = HsInteger a x b +convertLit (HsRat a x b) = HsRat a x b +convertLit (HsFloatPrim a x) = HsFloatPrim a x +convertLit (HsDoublePrim a x) = HsDoublePrim a x +convertLit (XLit a) = XLit a {- Note [ol_rebindable] |