@@ -512,6 +512,7 @@ elab ist info emode opts fn tm
512512 recoverableErr (TooManyArguments _) = False
513513 recoverableErr (CantSolveGoal _ _) = False
514514 recoverableErr (CantResolveAlts _) = False
515+ recoverableErr (NoValidAlts _) = True
515516 recoverableErr (ProofSearchFail (Msg _)) = True
516517 recoverableErr (ProofSearchFail _) = False
517518 recoverableErr (ElaboratingArg _ _ _ e) = recoverableErr e
@@ -526,6 +527,7 @@ elab ist info emode opts fn tm
526527 _ -> filter isLend alts -- special case hack for 'Borrowed'
527528 pruneAlts (ElaboratingArg _ _ _ e) alts env = pruneAlts e alts env
528529 pruneAlts (At _ e) alts env = pruneAlts e alts env
530+ pruneAlts (NoValidAlts _) alts env = alts
529531 pruneAlts _ alts _ = filter isLend alts
530532
531533 hasArg n env ap | isLend ap = True -- special case hack for 'Borrowed'
@@ -1377,6 +1379,12 @@ elab ist info emode opts fn tm
13771379 (t : map (mkCoerce env t) cs)
13781380 return t'
13791381 where
1382+-- mkCoerce env (PAlternative ns aty alts@(a : as)) n
1383+-- = let fc = maybe (fileFC "Coercion") id (highestFC a) in
1384+-- addImplBound ist (map fst env)
1385+-- (PAlternative ns aty
1386+-- (map (\t -> PApp fc (PRef fc n) [pexp (PCoerced t)])
1387+-- alts))
13801388 mkCoerce env t n = let fc = maybe (fileFC "Coercion") id (highestFC t) in
13811389 addImplBound ist (map fst env)
13821390 (PApp fc (PRef fc [] n) [pexp (PCoerced t)])