summaryrefslogtreecommitdiff
path: root/testsuite/tests/typing-misc/external_arity.ml
blob: 487fa8356334b182404ae5ae251f1aa0803d1997 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(* TEST
 expect;
*)

let f a b c = a + b + c

let _ : int = Obj.magic f None None None

[%%expect
{|
val f : int -> int -> int -> int = <fun>
- : int = 0
|}]

external cmp : 'a -> 'b = "%compare"

[%%expect
{|
Line 1, characters 0-36:
1 | external cmp : 'a -> 'b = "%compare"
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Wrong arity for builtin primitive "%compare"
|}]

external apply : 'a -> 'b = "%apply"

[%%expect
{|
Line 1, characters 0-36:
1 | external apply : 'a -> 'b = "%apply"
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Wrong arity for builtin primitive "%apply"
|}]