summaryrefslogtreecommitdiffstats
path: root/testsuite/tests/typing-misc/labels.ml.reference
blob: f8be126bb87940da23c00ff64b134fb92bb7623c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

#   val f : x:int -> int = <fun>
# Characters 5-6:
  f ?x:0;;
       ^
Warning 43: the label x is not optional.
- : int = 1
#     val foo : (unit -> unit) -> unit = <fun>
# val g : ?x:'a -> unit -> unit = <fun>
# - : unit = ()
#     Characters 19-38:
  foo (fun ?opt () -> ()) ;; (* fails *)
      ^^^^^^^^^^^^^^^^^^^
Error: This function should have type unit -> unit
       but its first argument is labelled ?opt
#