Version française
Home     About     Download     Resources     Contact us    
Browse thread
Labeled arguments and polymorphic return types
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Andre Nathan <andre@d...>
Subject: Labeled arguments and polymorphic return types
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