summaryrefslogtreecommitdiff
path: root/compiler/GHC/Iface/Ext/Utils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Iface/Ext/Utils.hs')
-rw-r--r--compiler/GHC/Iface/Ext/Utils.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/GHC/Iface/Ext/Utils.hs b/compiler/GHC/Iface/Ext/Utils.hs
index b0a6f84404..102f6db656 100644
--- a/compiler/GHC/Iface/Ext/Utils.hs
+++ b/compiler/GHC/Iface/Ext/Utils.hs
@@ -12,6 +12,7 @@ import GHC.Core.Map
import GHC.Driver.Session ( DynFlags )
import GHC.Data.FastString ( FastString, mkFastString )
import GHC.Iface.Type
+import GHC.Core.Multiplicity
import GHC.Types.Name hiding (varName)
import GHC.Types.Name.Set
import GHC.Utils.Outputable hiding ( (<>) )
@@ -156,8 +157,8 @@ hieTypeToIface = foldType go
go (HLitTy l) = IfaceLitTy l
go (HForAllTy ((n,k),af) t) = let b = (occNameFS $ getOccName n, k)
in IfaceForAllTy (Bndr (IfaceTvBndr b) af) t
- go (HFunTy a b) = IfaceFunTy VisArg a b
- go (HQualTy pred b) = IfaceFunTy InvisArg pred b
+ go (HFunTy w a b) = IfaceFunTy VisArg w a b
+ go (HQualTy pred b) = IfaceFunTy InvisArg many_ty pred b
go (HCastTy a) = a
go HCoercionTy = IfaceTyVar "<coercion type>"
go (HTyConApp a xs) = IfaceTyConApp a (hieToIfaceArgs xs)
@@ -233,12 +234,13 @@ getTypeIndex t
k <- getTypeIndex (varType v)
i <- getTypeIndex t
return $ HForAllTy ((varName v,k),a) i
- go (FunTy { ft_af = af, ft_arg = a, ft_res = b }) = do
+ go (FunTy { ft_af = af, ft_mult = w, ft_arg = a, ft_res = b }) = do
ai <- getTypeIndex a
bi <- getTypeIndex b
+ wi <- getTypeIndex w
return $ case af of
- InvisArg -> HQualTy ai bi
- VisArg -> HFunTy ai bi
+ InvisArg -> case w of Many -> HQualTy ai bi; _ -> error "Unexpected non-unrestricted predicate"
+ VisArg -> HFunTy wi ai bi
go (LitTy a) = return $ HLitTy $ toIfaceTyLit a
go (CastTy t _) = do
i <- getTypeIndex t