Skip to content

Commit 3269748

Browse files
authored
[Patterns] Typo fixed. Boolean replaced by bool (#2853)
1 parent b23711a commit 3269748

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

accepted/future-releases/0546-patterns/feature-specification.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ value. We don't allow all expressions here because many expression forms
451451
syntactically overlap other kinds of patterns. We avoid ambiguity while
452452
supporting terse forms of the most common constant expressions like so:
453453

454-
* Simple "primitive" literals like Booleans and numbers are valid patterns
454+
* Simple "primitive" literals like booleans and numbers are valid patterns
455455
since they aren't ambiguous. We also allow unary `-` expressions on
456456
numeric literals since users think of `-2` as a single literal and not the
457457
literal `2` with a unary `-` applied to it (which is how the language
@@ -2548,7 +2548,7 @@ fail in some way.*
25482548
other cases).
25492549

25502550
2. If there is a guard clause, evaluate it. If it does not evaluate to a
2551-
Boolean, throw a runtime error. *This can happen if the guard
2551+
`bool`, throw a runtime error. *This can happen if the guard
25522552
expression's type is `dynamic`.* If it evaluates to `false`, continue to
25532553
the next case (or default or exit).
25542554

@@ -2592,7 +2592,7 @@ fail in some way.*
25922592
to the next case.
25932593

25942594
2. If there is a guard clause, evaluate it. If it does not evaluate to a
2595-
Boolean, throw a runtime error. If it evaluates to `false`, continue to
2595+
`bool`, throw a runtime error. If it evaluates to `false`, continue to
25962596
the next case.
25972597

25982598
3. Evaluate the expression after the case and yield that as the result of
@@ -2736,7 +2736,7 @@ Where `<keyword>` is `var` or `final` is treated like so:
27362736
27372737
1. If there is a guard clause:
27382738
2739-
1. Evaluate it. If it does not evaluate to a Boolean, throw a runtime
2739+
1. Evaluate it. If it does not evaluate to a `bool`, throw a runtime
27402740
error. *This can happen if the guard expression's type is
27412741
`dynamic`.*
27422742
@@ -2758,7 +2758,7 @@ Where `<keyword>` is `var` or `final` is treated like so:
27582758
27592759
1. If there is a guard clause:
27602760
2761-
1. Evaluate it. If it does not evaluate to a Boolean, throw a runtime
2761+
1. Evaluate it. If it does not evaluate to a `bool`, throw a runtime
27622762
error. *This can happen if the guard expression's type is
27632763
`dynamic`.*
27642764
@@ -2816,7 +2816,7 @@ To match a pattern `p` against a value `v`:
28162816
28172817
2. The pattern matches if `r` is true and fails otherwise. *This takes
28182818
into account the built-in semantics that `null` is only equal to
2819-
`null`. The result will always be a Boolean since operator `==` on
2819+
`null`. The result will always be a `bool` since operator `==` on
28202820
Object is declared to return `bool`.*
28212821
28222822
2. Else if the operator is `!=`:
@@ -2831,7 +2831,7 @@ To match a pattern `p` against a value `v`:
28312831
28322832
1. Let `r` be the result of calling `op` on `v` with argument `c`.
28332833
2834-
2. If `r` is not a Boolean then throw a runtime error. *This can happen
2834+
2. If `r` is not a `bool` then throw a runtime error. *This can happen
28352835
if the operator on `v`'s type returns `dynamic`.*
28362836
28372837
3. The pattern matches if `r` is true and fails otherwise.
@@ -3510,7 +3510,7 @@ Here is one way it could be broken down into separate pieces:
35103510
* Pattern-if statements
35113511
35123512
* **Logical patterns.** If we're going to add `==` patterns, we may as well
3513-
support other Boolean infix operators. And if we're going to support the
3513+
support other boolean infix operators. And if we're going to support the
35143514
comparison operators, then `&&` is useful for numeric ranges. It's weird to
35153515
have `&&` without `||` so we may as well do that too (and it's useful for
35163516
switch expressions). Once we have infix patterns precedence comes into play,

0 commit comments

Comments
 (0)