Consider an example like this:
f : {n} (fin n) => [2*n] -> [n] -> [n]
f (xs # ys) zs
| (n > 0) => xs + zs
| () => ys + zs
Currently this generates warnings like this:
[warning] at issue2090.cry:2:9--2:11
Unused name: ys
[warning] at issue2090.cry:2:4--2:6
Unused name: xs
This is an artifact of the fact that we implement prop guards by lifting each case to a separate top-level function. So essentially the warning says that the given variable is not used in this particular alternative. To work around this we probably need to delay reporting the warnings for alternatives, and only report the ones that are not used in any of the alternatives.
Consider an example like this:
Currently this generates warnings like this:
This is an artifact of the fact that we implement prop guards by lifting each case to a separate top-level function. So essentially the warning says that the given variable is not used in this particular alternative. To work around this we probably need to delay reporting the warnings for alternatives, and only report the ones that are not used in any of the alternatives.