[handle HsCase's that have not been wrappen in AsPats
John Meacham <john@repetae.net>**20060308012829] hunk ./FrontEnd/Tc/Main.hs 132
-{-
-tiExpr (HsVar v) typ = do
-    sc <- lookupName (toName Val v)
-    sc `subsumes` typ
-    return (HsVar v)
--}
+tiExpr (HsAsPat ap (HsCase e alts)) typ = withContext (simpleMsg $ "in the case expression\n   case " ++ show e ++ " of ...") $ do
+    scrutinee <- newBox Star
+    e' <- tcExpr e scrutinee
+    alts' <- mapM (tcAlt scrutinee typ) alts
+    addToCollectedEnv (Map.singleton (toName Val ap) typ)
+    return (HsAsPat ap (HsCase e' alts'))
+
+tiExpr ec@HsCase {} typ = do
+    nn <- newUniq
+    let n = toName Val ("As@",show nn)
+    tiExpr (HsAsPat (nameName n) ec) typ
+
hunk ./FrontEnd/Tc/Main.hs 292
-tiExpr (HsCase e alts) typ = withContext (simpleMsg $ "in the case expression\n   case " ++ show e ++ " of ...") $ do
-    scrutinee <- newBox Star
-    e' <- tcExpr e scrutinee
-    alts' <- mapM (tcAlt scrutinee typ) alts
-    return (HsCase e' alts')