[ fix #2640 ] Do not shadow function name during case split

This commit is contained in:
Guillaume Allais 2022-09-02 10:49:19 +01:00 committed by G. Allais
parent c2be1677da
commit 552f27f813
6 changed files with 23 additions and 2 deletions

View File

@ -119,7 +119,8 @@ findAllVars (Bind _ x (Let _ _ _ _) sc)
= x :: findAllVars sc
findAllVars (Bind _ x (PLet _ _ _ _) sc)
= x :: findAllVars sc
findAllVars _ = []
-- #2640 also grab the name of the function being defined
findAllVars t = toList (dropNS <$> getDefining t)
export
explicitlyBound : Defs -> NF [] -> Core (List Name)

View File

@ -101,7 +101,7 @@ idrisTestsInteractive = MkTestPool "Interactive editing" [] Nothing
"interactive029", "interactive030", "interactive031", "interactive032",
"interactive033", "interactive034", "interactive035", "interactive036",
"interactive037", "interactive038", "interactive039", "interactive040",
"interactive041", "interactive042", "interactive043"]
"interactive041", "interactive042", "interactive043", "interactive044"]
idrisTestsInterface : TestPool
idrisTestsInterface = MkTestPool "Interface" [] Nothing

View File

@ -0,0 +1,5 @@
data Chaos : Type where
Emerald : (colour : Nat) -> Chaos
colour : Chaos -> ()
colour c = ?colour_rhs_5

View File

@ -0,0 +1,4 @@
1/1: Building SplitShadowGen (SplitShadowGen.idr)
Main> colour (Emerald k) = ?colour_rhs_6
Main> Loaded file SplitShadowGen.idr
Main> Bye for now!

View File

@ -0,0 +1,3 @@
:cs 5 7 c
:r
:q

View File

@ -0,0 +1,8 @@
rm -rf build
rm -f SplitShadowGen.idr
cp SplitShadow.idr SplitShadowGen.idr
$1 --no-color --console-width 0 --no-banner SplitShadowGen.idr < input
rm SplitShadowGen.idr