Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problematic interaction between unused arguments warnings #4117

Closed
vicuna opened this issue Sep 19, 2006 · 2 comments
Closed

Problematic interaction between unused arguments warnings #4117

vicuna opened this issue Sep 19, 2006 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Sep 19, 2006

Original bug ID: 4117
Reporter: @yakobowski
Status: closed (set by @garrigue on 2007-01-30T01:54:29Z)
Resolution: not a bug
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)

Bug description

Consider a fonction of signature
val union : (keep:node -> lose:node -> node) -> keep:node -> lose:node -> unit

(I use it to fuse two multi-equations during unification, while specifying how to update the descriptors. In particular, I need to know which node is kept, because in case of a Var-Constr unification, I want to keep the constructor).

If I try to entirely discard one of the descriptors, I can:

  • apply it to (fun ~keep ~lose -> keep). Then I get a warning that lose is not used
  • apply it without labels (but this defeats the purpose of using labels in the first place)
  • apply it with juste one label (fun ~keep _ -> keep), but typing of labels
    prevent this.

Maybe the warning on the first line could be moved to the second category of warnings for unused variables ?

--
Boris

@vicuna
Copy link
Author

vicuna commented Sep 19, 2006

Comment author: @damiendoligez

Keep in mind that ~lose is an abbreviation for ~lose:lose, so you can silence the warning by
applying your "option" function to (fun ~keep ~lose:_ -> keep).

Please tell me if this solves your problem.

@vicuna
Copy link
Author

vicuna commented Sep 20, 2006

Comment author: @yakobowski

The syntax is a bit strange, but this seems preferable to removing the warning from -Y. Thanks for the hint !

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

No branches or pull requests

1 participant