mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-18 16:51:51 +03:00
[ fix ] auto search returns no solution instead of ambiguous solution
This commit is contained in:
parent
f8adee7059
commit
1807cdcba7
@ -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)
|
||||
|
5
tests/idris2/error/error028/Issue3313.idr
Normal file
5
tests/idris2/error/error028/Issue3313.idr
Normal 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
|
15
tests/idris2/error/error028/expected
Normal file
15
tests/idris2/error/error028/expected
Normal 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)
|
3
tests/idris2/error/error028/run
Executable file
3
tests/idris2/error/error028/run
Executable file
@ -0,0 +1,3 @@
|
||||
. ../../../testutils.sh
|
||||
|
||||
check Issue3313.idr
|
Loading…
Reference in New Issue
Block a user