Skip to content

Commit

Permalink
Typos in expressions.md on inspect expressions. (hsutter#1094)
Browse files Browse the repository at this point in the history
Signed-off-by: gregmarr <gregmarr@users.noreply.github.com>
  • Loading branch information
gregmarr authored Jun 5, 2024
1 parent d136153 commit 37299f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/cpp2/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ An `inspect expr -> Type = { /* alternatives */ }` expression allows pattern mat

- `expr` is evaluated once.

- Each alternative is spelled `is C = statement;` and are evaluated in order. Each `is C` is evaluated if called with `expr is C`, and if it alternative evaluates to `#!cpp true`, then its `#!cpp = alternative;` body is used as the value of the entire `inspect` expression, and the meaning is the same as if the entire `inspect` expression had been written as just `#!cpp :Type = alternative;` — i.e., an unnamed object expression (aka 'temporary object') of type `Type` initialized with `alternative`.
- Each alternative is spelled `is C = statement;` and are evaluated in order. Each `is C` is evaluated as if called with `expr is C`, and if it evaluates to `#!cpp true`, then its `#!cpp = alternative;` body is used as the value of the entire `inspect` expression, and the meaning is the same as if the entire `inspect` expression had been written as just `#!cpp :Type = alternative;` — i.e., an unnamed object expression (aka 'temporary object') of type `Type` initialized with `alternative`.

- A catchall `is _` is required.

Expand Down

0 comments on commit 37299f2

Please sign in to comment.