Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / regression / overloading.sml
1 (* overloading.sml *)
2
3 (* Checks overloading resolution. *)
4
5 val z = 1: Int16.int
6 val y = z + 2
7 val x = (valOf Int16.minInt) + z
8
9 fun f(x,y) = (x + y)/y
10 fun g(x,y) = x + (y/y)
11
12 signature S = sig end
13
14 val x = f(1.2, 2.3) + g(1.0, 2.0);
15
16 fun f x =
17 x + let
18 fun g() = x
19 in
20 g() * 2.0
21 end;
22
23
24 (* Checks each overloaded operator at each type. *)