[ fix ] auto search returns no solution instead of ambiguous solution

This commit is contained in:
Steve Dunham 2024-06-15 14:56:23 -07:00
parent f8adee7059
commit 1807cdcba7
4 changed files with 24 additions and 0 deletions

View File

@ -142,6 +142,7 @@ anyOne fc env top [elab]
= catch elab $
\case
err@(CantSolveGoal _ _ _ _ _) => throw err
err@(AmbiguousSearch _ _ _ _) => throw err
_ => throw $ CantSolveGoal fc (gamma !(get Ctxt)) [] top Nothing
anyOne fc env top (elab :: elabs)
= tryUnify elab (anyOne fc env top elabs)

View File

@ -0,0 +1,5 @@
data Expr : Type -> Type where
Add : (Integral n) => n -> n -> Expr n
eval : (Integral n) => Expr n -> n
eval (Add x y) = x + y

View File

@ -0,0 +1,15 @@
1/1: Building Issue3313 (Issue3313.idr)
Error: While processing right hand side of eval. Multiple solutions found in search of:
Integral n
Issue3313:5:18--5:23
1 | data Expr : Type -> Type where
2 | Add : (Integral n) => n -> n -> Expr n
3 |
4 | eval : (Integral n) => Expr n -> n
5 | eval (Add x y) = x + y
^^^^^
Possible correct results:
conArg (implicitly bound at Issue3313:5:1--5:23)
conArg (implicitly bound at Issue3313:5:1--5:23)

View File

@ -0,0 +1,3 @@
. ../../../testutils.sh
check Issue3313.idr