Debian Codegraph @

test-suite/output/RecordFieldErrors.v

raw
1 (** Check that various errors in record fields are reported with the correct
2 underlying issue. *)
3
4 Record t :=
5 { foo: unit }.
6
7 Record t' :=
8 { bar: unit }.
9
10 Fail Check {| unit := tt |}.
11 (* unit: Not a projection. *)
12
13 Fail Check {| unit := tt;
14 foo := tt |}.
15 (* unit: Not a projection. *)
16
17 Fail Check {| foo := tt;
18 bar := tt |}.
19 (* This record contains fields of both t and t'. *)
20
21 Fail Check {| unit := tt;
22 unit := tt |}.
23 (* unit: Not a projection. *)
24
25 Fail Check {| foo := tt;
26 foo := tt |}.
27 (* This record defines several times the field foo. *)
28
29 Fail Check {| foo := tt;
30 unit := tt;
31 unit := tt |}.
32 (* This is slightly wrong (would prefer "unit: Not a projection."), but it's
33 acceptable and seems an unlikely mistake. *)
34 (* This record defines several times the field unit. *)
35
36 Fail Check {| foo := tt;
37 unit := tt |}.
38 (* unit: Not a projection. *)