X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FbasicTypes%2FVar.lhs;h=eec6c803b461be484597a7b8ead612570893820c;hb=11b059fe35fe7bdcf43d4ce3246d0b9ae1671391;hp=0c30ab4172142926d4b16b99bedec9cc906804f8;hpb=6084fb5517da34f65034370a3695e2af3b85ce2b;p=ghc-hetmet.git diff --git a/compiler/basicTypes/Var.lhs b/compiler/basicTypes/Var.lhs index 0c30ab4..eec6c80 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,7 +288,7 @@ mkTcTyVar name kind details %************************************************************************ \begin{code} -type CoVar = Var -- ^ A coercion variable is simply a type +type CoVar = Var -- A coercion variable is simply a type -- variable of kind @ty1 :=: ty2@. Hence its -- 'varType' is always @PredTy (EqPred t1 t2)@ @@ -391,8 +390,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