mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-11 14:23:19 +03:00
[ fix #2640 ] Do not shadow function name during case split
This commit is contained in:
parent
c2be1677da
commit
552f27f813
@ -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)
|
||||
|
@ -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
|
||||
|
5
tests/idris2/interactive044/SplitShadow.idr
Normal file
5
tests/idris2/interactive044/SplitShadow.idr
Normal file
@ -0,0 +1,5 @@
|
||||
data Chaos : Type where
|
||||
Emerald : (colour : Nat) -> Chaos
|
||||
|
||||
colour : Chaos -> ()
|
||||
colour c = ?colour_rhs_5
|
4
tests/idris2/interactive044/expected
Normal file
4
tests/idris2/interactive044/expected
Normal 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!
|
3
tests/idris2/interactive044/input
Normal file
3
tests/idris2/interactive044/input
Normal file
@ -0,0 +1,3 @@
|
||||
:cs 5 7 c
|
||||
:r
|
||||
:q
|
8
tests/idris2/interactive044/run
Executable file
8
tests/idris2/interactive044/run
Executable 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
|
Loading…
Reference in New Issue
Block a user