mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-01 21:40:58 +00:00
remove unit type from EmptyDefsFinal
This commit is contained in:
parent
93ef5e42dc
commit
129ca94733
7 changed files with 13 additions and 13 deletions
|
|
@ -308,7 +308,7 @@ pub enum Expr<'a> {
|
|||
|
||||
/// Used in place of an expression when the final expression is empty
|
||||
/// This may happen if the final expression is actually a suffixed statement
|
||||
EmptyDefsFinal(),
|
||||
EmptyDefsFinal,
|
||||
|
||||
Backpassing(&'a [Loc<Pattern<'a>>], &'a Loc<Expr<'a>>, &'a Loc<Expr<'a>>),
|
||||
Expect(&'a Loc<Expr<'a>>, &'a Loc<Expr<'a>>),
|
||||
|
|
@ -1848,7 +1848,7 @@ impl<'a> Malformed for Expr<'a> {
|
|||
OpaqueRef(_) |
|
||||
SingleQuote(_) | // This is just a &str - not a bunch of segments
|
||||
IngestedFile(_, _) |
|
||||
EmptyDefsFinal() |
|
||||
EmptyDefsFinal |
|
||||
Crash => false,
|
||||
|
||||
Str(inner) => inner.is_malformed(),
|
||||
|
|
|
|||
|
|
@ -951,7 +951,7 @@ pub fn parse_single_def_assignment<'a>(
|
|||
Err(_) => {
|
||||
// Unable to parse more defs, continue and return the first parsed expression as a stement
|
||||
let empty_return =
|
||||
arena.alloc(Loc::at(first_loc_expr.region, Expr::EmptyDefsFinal()));
|
||||
arena.alloc(Loc::at(first_loc_expr.region, Expr::EmptyDefsFinal));
|
||||
let value_def = ValueDef::Body(
|
||||
arena.alloc(def_loc_pattern),
|
||||
arena.alloc(Loc::at(
|
||||
|
|
@ -1242,7 +1242,7 @@ fn parse_defs_expr<'a>(
|
|||
MadeProgress,
|
||||
Expr::Defs(
|
||||
arena.alloc(local_defs),
|
||||
arena.alloc(Loc::at_zero(Expr::EmptyDefsFinal())),
|
||||
arena.alloc(Loc::at_zero(Expr::EmptyDefsFinal)),
|
||||
),
|
||||
state,
|
||||
));
|
||||
|
|
@ -2169,7 +2169,7 @@ fn expr_to_pattern_help<'a>(arena: &'a Bump, expr: &Expr<'a>) -> Result<Pattern<
|
|||
| Expr::SpaceAfter(..)
|
||||
| Expr::ParensAround(..)
|
||||
| Expr::RecordBuilder(..)
|
||||
| Expr::EmptyDefsFinal() => unreachable!(),
|
||||
| Expr::EmptyDefsFinal => unreachable!(),
|
||||
|
||||
Expr::Record(fields) => {
|
||||
let patterns = fields.map_items_result(arena, |loc_assigned_field| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue