Skip to content

Commit 42de176

Browse files
committed
Irrefutable patterns are allowed, just linted against
1 parent c9ddca7 commit 42de176

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/statements.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,13 @@ except when they are shadowed by another variable declaration.
7575
> ( `:` [_Type_] )<sup>?</sup> `=` [_Expression_] `else` [_BlockExpression_] `;`
7676
7777
A *`let else` statement* introduces a new set of [variables], given by a
78-
refutable [pattern]. The pattern is followed optionally by a type
79-
annotation. When no type annotation is given, the compiler will infer the type,
80-
or signal an error if insufficient type information is available for definite
81-
inference. It is is then followed by an initializer expression as well as a
82-
diverging `else` block.
78+
[pattern]. The pattern is followed optionally by a type annotation. When no type
79+
annotation is given, the compiler will infer the type, or signal an error if
80+
insufficient type information is available for definite inference. It is is
81+
then followed by an initializer expression as well as a diverging `else` block.
82+
Compared to `let` statement patterns which have to be irrefutable, `let else`
83+
patterns can be both irrefutable and refutable. However, as it is besides the
84+
point of, irrefutable patterns in `let else` are linted against.
8385

8486
Any variables introduced by a variable declaration are visible
8587
from the point of declaration until the end of the enclosing block scope,

0 commit comments

Comments
 (0)