[project @ 2002-03-26 19:08:19 by simonpj]
authorsimonpj <unknown>
Tue, 26 Mar 2002 19:08:19 +0000 (19:08 +0000)
committersimonpj <unknown>
Tue, 26 Mar 2002 19:08:19 +0000 (19:08 +0000)
Fix readHoleResult bug

ghc/compiler/typecheck/TcPat.lhs

index cb08317..ea64699 100644 (file)
@@ -139,7 +139,10 @@ tcPat tc_bndr pat_in@(AsPatIn name pat) pat_ty
              tvs, (name, bndr_id) `consBag` ids, lie_avail)
 
 tcPat tc_bndr WildPatIn pat_ty
-  = returnTc (WildPat pat_ty, emptyLIE, emptyBag, emptyBag, emptyLIE)
+  = zapToType pat_ty                   `thenNF_Tc` \ pat_ty' ->
+       -- We might have an incoming 'hole' type variable; no annotation
+       -- so zap it to a type.  Rather like tcMonoPatBndr.
+    returnTc (WildPat pat_ty', emptyLIE, emptyBag, emptyBag, emptyLIE)
 
 tcPat tc_bndr (ParPatIn parend_pat) pat_ty
   = tcPat tc_bndr parend_pat pat_ty