File tree Expand file tree Collapse file tree 4 files changed +27
-10
lines changed
Expand file tree Collapse file tree 4 files changed +27
-10
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,13 @@ let fancy_of_message msg =
121121 if msg.spans = [] then
122122 [G.Diagnostic.Label. primaryf ~range: (range msg.at) " " ]
123123 else
124- List. map mk_span msg.spans in
124+ let spans = List. map mk_span msg.spans in
125+ let primary_spans = List. filter (fun span -> span.prio = Primary ) msg.spans in
126+ if primary_spans = [] then
127+ G.Diagnostic.Label. primaryf ~range: (range msg.at) " " :: spans
128+ else
129+ spans
130+ in
125131 let severity = match msg.sev with
126132 | Error -> G.Diagnostic.Severity. Error
127133 | Warning -> G.Diagnostic.Severity. Warning
Original file line number Diff line number Diff line change @@ -22,8 +22,10 @@ because the type
2222error[M0018]: duplicate type field name T in object type
2323 ┌─ bad-type-comp.mo:7:73
2424 7 │ ignore ((module { public type T = Null}) : module { type T = Null; type T = Null });
25- │ - - used more than once
26- │ │
25+ │ - ^
26+ │ │ │
27+ │ │
28+ │ │ used more than once
2729 │ first use of T
2830error[M0029]: unbound type T
2931Did you mean type Text?
Original file line number Diff line number Diff line change @@ -5,16 +5,21 @@ error[M0051]: duplicate definition for m in block
55error[M0018]: duplicate field name foo in object type
66 ┌─ duplicate-field.mo:8:22
77 8 │ type T = {foo : Int; foo: Bool}
8- │ --- --- used more than once
9- │ │
8+ │ --- ^^^
9+ │ │ │
10+ │ │
11+ │ │ used more than once
1012 │ first use of foo
1113error[M0018]: duplicate field name foo in object type
1214 ┌─ duplicate-field.mo:21:3
1315 13 │ foo : Int;
1416 │ --- first use of foo
1517 ·
1618 21 │ foo: Bool;
17- │ --- used more than once
19+ │ ^^^
20+ │ │
21+ │
22+ │ used more than once
1823error[M0019]: field names foo and nxnnbkddcv in object type have colliding hashes
1924 ┌─ duplicate-field.mo:26:22
2025 26 │ type T = {foo : Int; nxnnbkddcv: Bool}
@@ -26,8 +31,10 @@ error[M0019]: tag names foo and nxnnbkddcv in variant type have colliding hashes
2631error[M0018]: duplicate field name foo in object
2732 ┌─ duplicate-field.mo:34:18
2833 34 │ ignore({foo = 5; foo = true});
29- │ --- --- used more than once
30- │ │
34+ │ --- ^^^
35+ │ │ │
36+ │ │
37+ │ │ used more than once
3138 │ first use of foo
3239error[M0019]: field names foo and nxnnbkddcv in object have colliding hashes
3340 ┌─ duplicate-field.mo:38:18
Original file line number Diff line number Diff line change 11error[M0018]: duplicate type field name T in object type
22 ┌─ type-comp.mo:3:42
33 3 │ type MT = module { type T = Null; type T<A> = A }; // reject
4- │ - - used more than once
5- │ │
4+ │ - ^
5+ │ │ │
6+ │ │
7+ │ │ used more than once
68 │ first use of T
79error[M0046]: type argument
810 P2
You can’t perform that action at this time.
0 commit comments