caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Labeled arguments and polymorphic return types
@ 2007-08-11 18:17 Andre Nathan
  2007-08-13  8:51 ` [Caml-list] " Jacques Garrigue
  0 siblings, 1 reply; 3+ messages in thread
From: Andre Nathan @ 2007-08-11 18:17 UTC (permalink / raw)
  To: caml-list

Hello

Consider the following definition:

# let f ~a = print_int a; raise Exit;;
val f : a:int -> 'a = <fun>

If I call f without using the argument label, I get the following
warning:

# f 1;;
Warning X: this argument will not be used by the function.
- : a:int -> 'a = <fun>

The call works if I use the label ("f ~a:1"), if I define f without a
label for its argument, or if I remove the "raise" statement (causing
the return value to be unit instead of 'a).

Why is this warning generated?

Thanks in advance,
Andre


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-13 15:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-11 18:17 Labeled arguments and polymorphic return types Andre Nathan
2007-08-13  8:51 ` [Caml-list] " Jacques Garrigue
2007-08-13 15:53   ` Andre Nathan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).