Commit 7fdc2a39 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Add missing case in TcUnify.matchExpectedFunKind

This fixes Trac #7278
parent 6e3e64ae
......@@ -1003,18 +1003,21 @@ happy to have types of kind Constraint on either end of an arrow.
matchExpectedFunKind :: TcKind -> TcM (Maybe (TcKind, TcKind))
-- Like unifyFunTy, but does not fail; instead just returns Nothing
matchExpectedFunKind (TyVarTy kvar) = do
maybe_kind <- readMetaTyVar kvar
case maybe_kind of
Indirect fun_kind -> matchExpectedFunKind fun_kind
Flexi ->
do { arg_kind <- newMetaKindVar
; res_kind <- newMetaKindVar
; writeMetaTyVar kvar (mkArrowKind arg_kind res_kind)
; return (Just (arg_kind,res_kind)) }
matchExpectedFunKind (FunTy arg_kind res_kind) = return (Just (arg_kind,res_kind))
matchExpectedFunKind _ = return Nothing
matchExpectedFunKind (FunTy arg_kind res_kind)
= return (Just (arg_kind,res_kind))
matchExpectedFunKind (TyVarTy kvar)
| isTcTyVar kvar, isMetaTyVar kvar
= do { maybe_kind <- readMetaTyVar kvar
; case maybe_kind of
Indirect fun_kind -> matchExpectedFunKind fun_kind
Flexi ->
do { arg_kind <- newMetaKindVar
; res_kind <- newMetaKindVar
; writeMetaTyVar kvar (mkArrowKind arg_kind res_kind)
; return (Just (arg_kind,res_kind)) } }
matchExpectedFunKind _ = return Nothing
-----------------
unifyKindX :: TcKind -- k1 (actual)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment