X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FbasicTypes%2FVar.lhs;h=4f1ed2e1a603f0ab73b9f710bd5103c1dc44917a;hb=dab87cc9e1269aa7e2e0589e156e024c16b85b1f;hp=cb0a11bace49bc8800913764a0033fe1c4c18b6e;hpb=9221fb31c4207700e9aaf1512e0f73afe487674f;p=ghc-hetmet.git diff --git a/compiler/basicTypes/Var.lhs b/compiler/basicTypes/Var.lhs index cb0a11b..4f1ed2e 100644 --- a/compiler/basicTypes/Var.lhs +++ b/compiler/basicTypes/Var.lhs @@ -273,8 +273,7 @@ mkTyVar name kind = ASSERT( not (isCoercionKind kind ) ) mkTcTyVar :: Name -> Kind -> TcTyVarDetails -> TyVar mkTcTyVar name kind details - = -- TOM: no longer valid assertion? - -- ASSERT( not (isCoercionKind kind) ) + = -- NB: 'kind' may be a coercion kind; cf, 'TcMType.newMetaCoVar' TcTyVar { varName = name, realUnique = getKeyFastInt (nameUnique name), varType = kind, @@ -289,8 +288,8 @@ mkTcTyVar name kind details %************************************************************************ \begin{code} -type CoVar = Var -- A coercion variable is simply a type - -- variable of kind @ty1 :=: ty2@. Hence its +type CoVar = TyVar -- A coercion variable is simply a type + -- variable of kind @ty1 ~ ty2@. Hence its -- 'varType' is always @PredTy (EqPred t1 t2)@ coVarName :: CoVar -> Name @@ -311,16 +310,9 @@ mkCoVar name kind = ASSERT( isCoercionKind kind ) } mkWildCoVar :: Kind -> TyVar --- ^ Create a type variable that is never referred to, so its unique doesn't matter -mkWildCoVar kind - = ASSERT( isCoercionKind kind ) - TyVar { varName = mkSysTvName wild_uniq (fsLit "co_wild"), - realUnique = _ILIT(1), - varType = kind, - isCoercionVar = True } - where - wild_uniq = mkBuiltinUnique 1 - +-- ^ Create a type variable that is never referred to, so its unique doesn't +-- matter +mkWildCoVar = mkCoVar (mkSysTvName (mkBuiltinUnique 1) (fsLit "co_wild")) \end{code} %************************************************************************ @@ -391,8 +383,9 @@ isLocalIdVar (LocalId {}) = True isLocalIdVar _ = False isCoVar :: Var -> Bool -isCoVar (v@(TyVar {})) = isCoercionVar v -isCoVar _ = False +isCoVar (v@(TyVar {})) = isCoercionVar v +isCoVar (TcTyVar {varType = kind}) = isCoercionKind kind -- used during solving +isCoVar _ = False -- | 'isLocalVar' returns @True@ for type variables as well as local 'Id's -- These are the variables that we need to pay attention to when finding free