update submodule pointer
[ghc-hetmet.git] / compiler / typecheck / TcHsType.lhs
index 43e58be..669c61c 100644 (file)
@@ -37,6 +37,7 @@ import TcMType
 import TcUnify
 import TcIface
 import TcType
+import TypeRep ( ecKind )
 import {- Kind parts of -} Type
 import Var
 import VarSet
@@ -365,6 +366,11 @@ kc_hs_type (HsPArrTy ty) = do
     ty' <- kcLiftedType ty
     return (HsPArrTy ty', liftedTypeKind)
 
+kc_hs_type (HsModalBoxType ecn ty) = do
+    kc_check_hs_type (HsTyVar ecn) (EK ecKind EkUnk)
+    ty' <- kcLiftedType ty
+    return (HsModalBoxType ecn ty', liftedTypeKind)
+
 kc_hs_type (HsNumTy n)
    = return (HsNumTy n, liftedTypeKind)
 
@@ -589,6 +595,11 @@ ds_type (HsPArrTy ty) = do
     checkWiredInTyCon parrTyCon
     return (mkPArrTy tau_ty)
 
+ds_type (HsModalBoxType ecn ty) = do
+    tau_ty <- dsHsType ty
+    checkWiredInTyCon hetMetCodeTypeTyCon
+    return (mkHetMetCodeTypeTy (mkTyVar ecn ecKind) tau_ty)
+
 ds_type (HsTupleTy boxity tys) = do
     tau_tys <- dsHsTypes tys
     checkWiredInTyCon tycon
@@ -867,7 +878,7 @@ tcPatSig ctxt sig res_ty
        ; if null sig_tvs then do {
                -- The type signature binds no type variables, 
                -- and hence is rigid, so use it to zap the res_ty
-                 wrap <- tcSubType PatSigOrigin (SigSkol ctxt) res_ty sig_ty
+                  wrap <- tcSubType PatSigOrigin ctxt res_ty sig_ty
                ; return (sig_ty, [], wrap)
 
        } else do {
@@ -896,7 +907,7 @@ tcPatSig ctxt sig res_ty
        ; sig_tvs' <- tcInstSigTyVars sig_tvs
         ; let sig_ty' = substTyWith sig_tvs sig_tv_tys' sig_ty
               sig_tv_tys' = mkTyVarTys sig_tvs'
-       ; wrap <- tcSubType PatSigOrigin (SigSkol ctxt) res_ty sig_ty'
+        ; wrap <- tcSubType PatSigOrigin ctxt res_ty sig_ty'
 
        -- Check that each is bound to a distinct type variable,
        -- and one that is not already in scope