Replace '*' by '..' in the doc of pattern matching
This commit is contained in:
parent
2b62371c20
commit
2c5b04cef1
@ -2865,7 +2865,7 @@ match_pat : pat [ ".." pat ] ? [ "if" expr ] ;
|
||||
A `match` expression branches on a *pattern*. The exact form of matching that
|
||||
occurs depends on the pattern. Patterns consist of some combination of
|
||||
literals, destructured enum constructors, structures, records and tuples, variable binding
|
||||
specifications, wildcards (`*`), and placeholders (`_`). A `match` expression has a *head
|
||||
specifications, wildcards (`..`), and placeholders (`_`). A `match` expression has a *head
|
||||
expression*, which is the value to compare to the patterns. The type of the
|
||||
patterns must equal the type of the head expression.
|
||||
|
||||
@ -2887,7 +2887,7 @@ match x {
|
||||
|
||||
The first pattern matches lists constructed by applying `Cons` to any head value, and a
|
||||
tail value of `~Nil`. The second pattern matches _any_ list constructed with `Cons`,
|
||||
ignoring the values of its arguments. The difference between `_` and `*` is that the pattern
|
||||
ignoring the values of its arguments. The difference between `_` and `..` is that the pattern
|
||||
`C(_)` is only type-correct if `C` has exactly one argument, while the pattern `C(..)` is
|
||||
type-correct for any enum variant `C`, regardless of how many arguments `C` has.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user