mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-11-28 02:23:44 +03:00
Fix at-pattern leak in recursive with blocks (#2834)
This commit is contained in:
parent
947432fa30
commit
a84a5a32d9
@ -84,9 +84,9 @@ mutual
|
||||
= matchAll True [(f, f'), (a, a)]
|
||||
-- On RHS: Rely on unification to fill in the implicit
|
||||
getMatch False (INamedApp fc f n a) f'
|
||||
= getMatch False f f
|
||||
= getMatch False f f'
|
||||
getMatch False (IAutoApp fc f a) f'
|
||||
= getMatch False f f
|
||||
= getMatch False f f'
|
||||
-- Can't have an implicit in the clause if there wasn't a matching
|
||||
-- implicit in the parent
|
||||
getMatch lhs f (INamedApp fc f' n a)
|
||||
|
@ -246,7 +246,7 @@ idrisTestsReflection = MkTestPool "Quotation and Reflection" [] Nothing
|
||||
idrisTestsWith : TestPool
|
||||
idrisTestsWith = MkTestPool "With abstraction" [] Nothing
|
||||
[ "with001", "with002", "with004", "with005", "with006", "with007",
|
||||
"with008", "with009", "with010"
|
||||
"with008", "with009", "with010", "with011"
|
||||
]
|
||||
|
||||
idrisTestsIPKG : TestPool
|
||||
|
9
tests/idris2/with011/WithImplicits.idr
Normal file
9
tests/idris2/with011/WithImplicits.idr
Normal file
@ -0,0 +1,9 @@
|
||||
import Data.Vect
|
||||
import Data.Vect.Views.Extra
|
||||
|
||||
mergeSort : Ord a => {n : _} -> Vect n a -> Vect n a
|
||||
mergeSort input with (splitRec input)
|
||||
mergeSort [] | SplitRecNil = []
|
||||
mergeSort [x] | SplitRecOne = [x]
|
||||
mergeSort (xs ++ ys) | (SplitRecPair {xs} {ys} xs_rec ys_rec) =
|
||||
merge (mergeSort xs | xs_rec) (mergeSort ys | ys_rec)
|
1
tests/idris2/with011/expected
Normal file
1
tests/idris2/with011/expected
Normal file
@ -0,0 +1 @@
|
||||
1/1: Building WithImplicits (WithImplicits.idr)
|
3
tests/idris2/with011/run
Executable file
3
tests/idris2/with011/run
Executable file
@ -0,0 +1,3 @@
|
||||
rm -rf build
|
||||
|
||||
$1 --no-color --console-width 0 --no-banner -p contrib --check WithImplicits.idr
|
Loading…
Reference in New Issue
Block a user