From 49ccdd84d85bf9d75947456ae3782b78c831730b Mon Sep 17 00:00:00 2001 From: sof Date: Mon, 25 Aug 1997 22:28:37 +0000 Subject: [PATCH] [project @ 1997-08-25 22:28:37 by sof] new function: zonkSigTyVar --- ghc/compiler/typecheck/TcType.lhs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ghc/compiler/typecheck/TcType.lhs b/ghc/compiler/typecheck/TcType.lhs index 0af7c44..a4b7474 100644 --- a/ghc/compiler/typecheck/TcType.lhs +++ b/ghc/compiler/typecheck/TcType.lhs @@ -27,7 +27,7 @@ module TcType ( tcInstType, tcInstSigType, tcInstTcType, tcInstSigTcType, tcInstTheta, tcInstId, - zonkTcTyVars, + zonkTcTyVars, zonkSigTyVar, zonkTcType, zonkTcTypeToType, zonkTcTyVar, @@ -410,6 +410,16 @@ zonkTcTyVar tyvar BoundTo other -> zonkTcType other other -> returnNF_Tc (TyVarTy tyvar) +-- Signature type variables only get bound to each other, +-- never to a type +zonkSigTyVar :: TcTyVar s -> NF_TcM s (TcTyVar s) +zonkSigTyVar tyvar + = tcReadTyVar tyvar `thenNF_Tc` \ maybe_ty -> + case maybe_ty of + BoundTo ty@(TyVarTy tyvar') -> returnNF_Tc tyvar' -- tcReadTyVar never returns a bound tyvar + BoundTo other -> panic "zonkSigTyVar" -- Should only be bound to another tyvar + other -> returnNF_Tc tyvar + zonkTcType :: TcType s -> NF_TcM s (TcType s) zonkTcType (TyVarTy tyvar) = zonkTcTyVar tyvar -- 1.7.10.4