Add test of for record evaluation order

master
Pierre Chambart 2016-03-18 12:20:56 +01:00
parent 0cf5f5409f
commit 640b680050
2 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,30 @@
type r =
{ a : unit;
b : int;
c : char;
d : float; }
let r1 =
{
c = (print_endline "c1"; 'c');
a = print_endline "a1";
d = (print_endline "d1"; 1.);
b = (print_endline "b1"; 2);
}
let r2 =
{
b = (print_endline "b2"; 2);
d = (print_endline "d2"; 1.);
a = print_endline "a2";
c = (print_endline "c2"; 'c');
}
let r3 =
{ (print_endline "default"; r1) with
d = (print_endline "d3"; 1.);
c = (print_endline "c3"; 'c');
a = print_endline "a3";
}

View File

@ -0,0 +1,14 @@
d1
c1
b1
a1
d2
c2
b2
a2
default
d3
c3
a3
All tests succeeded.