#133 (closed)
FixesConsider the module:
import Data.List (last)
f :: a -> a
f failed = failed
g :: a -> a
g f = f
h :: a -> a
h last = last
local :: a -> a
local x = let y = x in let x = y in x
Currently we get:
src/Shadow.curry:9:3 Warning:
Shadowing symbol `f', bound at: src/Shadow.curry, line 6.1
|
9 | g f = f
| ^
src/Shadow.curry:15:28 Warning:
Shadowing symbol `x', bound at: src/Shadow.curry, line 15.7
|
15 | local x = let y = x in let x = y in x
|
With -Wimport-name-shadowing
as implemented in this branch (or -Wall
) we now additionally get:
src/Shadow.curry:6:3-6:8 Warning:
Shadowing symbol `failed', bound at: /Users/fredrik/git/kics2/lib/.curry/Prelude.icurry, line 227.1
|
6 | f failed = failed
| ^^^^^^
src/Shadow.curry:12:3-12:6 Warning:
Shadowing symbol `last', bound at: /Users/fredrik/git/kics2/lib/.curry/Data/List.icurry, line 32.1
|
12 | h last = last
| ^^^^
To do:
-
Add flag -
Implement warning in WarnCheck
-
Add test case
This warning is currently disabled by default, is this okay? (I'd argue that it's useful enough to be enabled in general, but would be fine either way)