Skip to content

Confusing unused names warnings with prop guards #2096

Description

@yav

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions