Backport from sid to buster
[hcoop/debian/mlton.git] / regression / undetermined.sml
CommitLineData
7f918cf1
CE
1(* undetermined.sml *)
2
3(* Checks inference for non-generalised types (aka "free type variables"). *)
4
5val f = (fn x => x) (fn x => x)
6structure A = struct end
7val y = f 7
8;
9
10structure A: sig val f: int -> int end =
11 struct
12 val f = (fn x => x) (fn x => x)
13 end
14;
15
16structure A : sig val a : int list ref end =
17struct
18 val a = ref nil
19end
20;
21
22val x = ref nil
23val _ = 1 :: !x
24;
25;
26;
27val _ =
28 let
29 val x = ref nil
30 val _ = 1 :: !x
31 in
32 ()
33 end
34;
35(* 2.sml *)
36val id = (fn x => x) (fn x => x)
37val _ = id 13
38;
39structure X =
40struct
41 val id = (fn x => x) (fn x => x)
42 val _ = id 13
43end
44;
45(* 4.sml *)
46datatype t = T
47val id = (fn x => x) (fn x => x)
48val _ = id T
49;
50(* 5.sml *)
51local
52 val id = (fn x => x) (fn x => x)
53in
54 val _ = id 13
55end
56;
57(* 7.sml *)
58val id = (fn x => x) (fn x => x)
59val _ = id 13
60val id = ()
61;