Version française
Home     About     Download     Resources     Contact us    
Browse thread
Commuting labeled arguments
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Philippe Veber <philippe.veber@g...>
Subject: Commuting labeled arguments
Hi all,

is this behaviour of the type checker expected ?

        Objective Caml version 3.11.0

# let f g x y = g ~x ~y;;
val f : (x:'a -> y:'b -> 'c) -> 'a -> 'b -> 'c = <fun>
# let g ~y ~x = x + y;;
val g : y:int -> x:int -> int = <fun>
# f g;;
Error: This expression has type y:int -> x:int -> int
       but is here used with type x:'a -> y:'b -> 'c

If so, I'm tempted to fill a report to mantis anyway, to get this said in
the manual (i've not seen anything for this case, but i might have missed
something).

Philippe.