Initial checkin of HetMet / -XModalTypes modifications
[ghc-hetmet.git] / compiler / typecheck / TcHsType.lhs
index 43e58be..f7f3da6 100644 (file)
@@ -365,6 +365,10 @@ kc_hs_type (HsPArrTy ty) = do
     ty' <- kcLiftedType ty
     return (HsPArrTy ty', liftedTypeKind)
 
+kc_hs_type (HsModalBoxType ecn ty) = do
+    ty' <- kcLiftedType ty
+    return (HsModalBoxType ecn ty', liftedTypeKind)
+
 kc_hs_type (HsNumTy n)
    = return (HsNumTy n, liftedTypeKind)
 
@@ -589,6 +593,13 @@ ds_type (HsPArrTy ty) = do
     checkWiredInTyCon parrTyCon
     return (mkPArrTy tau_ty)
 
+ds_type (HsModalBoxType ecn ty) = do
+    ecn' <- ds_app (HsTyVar ecn) []
+    tau_ty <- dsHsType ty
+    checkWiredInTyCon hetMetCodeTypeTyCon
+    return (mkHetMetCodeTypeTy (tcGetTyVar "totally bogus, dude" ecn') 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