No sentence for a & that cannot arrive
This commit is contained in:
parent
b2d1df300b
commit
9fd1eb113f
@ -283,12 +283,11 @@ let split_amp (items : Form.t list) : Form.t list * (string * Loc.t) option =
|
|||||||
in
|
in
|
||||||
go [] items
|
go [] items
|
||||||
|
|
||||||
|
(* Never handed a [&]: every list of items reaching here has been through
|
||||||
|
[split_amp], which stops at the first one and refuses every way of getting
|
||||||
|
the tail wrong itself. So there is no arm for it and no sentence about it. *)
|
||||||
let rec pat_of (f : Form.t) : pat =
|
let rec pat_of (f : Form.t) : pat =
|
||||||
match f.Form.v with
|
match f.Form.v with
|
||||||
| Form.Sym "&" ->
|
|
||||||
(* Only reachable inside a [ ] that [split_amp] already walked, so a second
|
|
||||||
[&] is the one that has no name of its own to go with. *)
|
|
||||||
Loc.fail f.Form.loc "& appears twice in this parameter list"
|
|
||||||
| Form.Sym s -> Pname (s, f.Form.loc)
|
| Form.Sym s -> Pname (s, f.Form.loc)
|
||||||
| Form.Vec items ->
|
| Form.Vec items ->
|
||||||
let elems, rest = split_amp items in
|
let elems, rest = split_amp items in
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user