@@ -512,6 +512,7 @@ elab ist info emode opts fn tm
512 recoverableErr (TooManyArguments _) = False
512 recoverableErr (TooManyArguments _) = False
513 recoverableErr (CantSolveGoal _ _) = False
513 recoverableErr (CantSolveGoal _ _) = False
514 recoverableErr (CantResolveAlts _) = False
514 recoverableErr (CantResolveAlts _) = False
515+ recoverableErr (NoValidAlts _) = True
515 recoverableErr (ProofSearchFail (Msg _)) = True
516 recoverableErr (ProofSearchFail (Msg _)) = True
516 recoverableErr (ProofSearchFail _) = False
517 recoverableErr (ProofSearchFail _) = False
517 recoverableErr (ElaboratingArg _ _ _ e) = recoverableErr e
518 recoverableErr (ElaboratingArg _ _ _ e) = recoverableErr e
@@ -526,6 +527,7 @@ elab ist info emode opts fn tm
526 _ -> filter isLend alts -- special case hack for 'Borrowed'
527 _ -> filter isLend alts -- special case hack for 'Borrowed'
527 pruneAlts (ElaboratingArg _ _ _ e) alts env = pruneAlts e alts env
528 pruneAlts (ElaboratingArg _ _ _ e) alts env = pruneAlts e alts env
528 pruneAlts (At _ e) alts env = pruneAlts e alts env
529 pruneAlts (At _ e) alts env = pruneAlts e alts env
530+ pruneAlts (NoValidAlts _) alts env = alts
529 pruneAlts _ alts _ = filter isLend alts
531 pruneAlts _ alts _ = filter isLend alts
531 hasArg n env ap | isLend ap = True -- special case hack for 'Borrowed'
533 hasArg n env ap | isLend ap = True -- special case hack for 'Borrowed'
@@ -1377,6 +1379,12 @@ elab ist info emode opts fn tm
1377 (t : map (mkCoerce env t) cs)
1379 (t : map (mkCoerce env t) cs)
1378 return t'
1380 return t'
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)])
1380 mkCoerce env t n = let fc = maybe (fileFC "Coercion") id (highestFC t) in
1388 mkCoerce env t n = let fc = maybe (fileFC "Coercion") id (highestFC t) in
1381 addImplBound ist (map fst env)
1389 addImplBound ist (map fst env)
1382 (PApp fc (PRef fc [] n) [pexp (PCoerced t)])
1390 (PApp fc (PRef fc [] n) [pexp (PCoerced t)])