Skip to content

Commit cb21d77

Browse files
GearsDatapackslpil
authored andcommitted
Update code after structural changes
1 parent 0e12e37 commit cb21d77

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

compiler-core/src/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2395,7 +2395,7 @@ pub enum BitArraySize<Type> {
23952395
},
23962396
}
23972397

2398-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
2398+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
23992399
pub enum IntOperator {
24002400
Add,
24012401
Subtract,

compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__inlining__inline_function_with_use_becomes_tail_recursive.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ count(From, To) ->
2727
From;
2828

2929
false ->
30-
echo(From, 6),
30+
echo(From, nil, 6),
3131
count(From + 1, To)
3232
end.
3333

compiler-core/src/exhaustiveness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@ pub struct Offset {
12341234
pub calculations: im::Vector<OffsetCalculation>,
12351235
}
12361236

1237-
#[derive(Clone, Eq, PartialEq, Debug, Hash)]
1237+
#[derive(Clone, Eq, PartialEq, Debug, Hash, serde::Serialize, serde::Deserialize)]
12381238
pub struct OffsetCalculation {
12391239
pub left: Offset,
12401240
pub right: Offset,

compiler-core/src/inline.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,11 @@ impl Inliner<'_> {
450450
location,
451451
type_,
452452
expression,
453+
message,
453454
} => TypedExpr::Echo {
454455
location,
455-
expression: expression
456-
.map(|boxed_expression| self.boxed_expression(boxed_expression)),
456+
expression: expression.map(|expression| self.boxed_expression(expression)),
457+
message: message.map(|message| self.boxed_expression(message)),
457458
type_,
458459
},
459460

@@ -1017,11 +1018,11 @@ impl<'ast> Visit<'ast> for FindInlinableParameters {
10171018
self.register_reference(name, *location);
10181019
}
10191020

1020-
fn visit_typed_pattern_var_usage(
1021+
fn visit_typed_bit_array_size_variable(
10211022
&mut self,
10221023
_location: &'ast SrcSpan,
10231024
name: &'ast EcoString,
1024-
constructor: &'ast Option<ValueConstructor>,
1025+
constructor: &'ast Option<Box<ValueConstructor>>,
10251026
_type_: &'ast Arc<Type>,
10261027
) {
10271028
let variant = match constructor {
@@ -1237,7 +1238,7 @@ impl FunctionToInlinable {
12371238
Some(InlinableExpression::Case {
12381239
subjects,
12391240
clauses,
1240-
compiled_case: compiled_case.clone(),
1241+
compiled_case: Box::new(compiled_case.clone()),
12411242
type_: self.type_(type_),
12421243
})
12431244
}
@@ -1413,7 +1414,7 @@ impl FunctionToInlinable {
14131414
TypedPattern::Int { .. }
14141415
| TypedPattern::Float { .. }
14151416
| TypedPattern::String { .. }
1416-
| TypedPattern::VarUsage { .. }
1417+
| TypedPattern::BitArraySize { .. }
14171418
| TypedPattern::Assign { .. }
14181419
| TypedPattern::Discard { .. }
14191420
| TypedPattern::List { .. }
@@ -1481,7 +1482,7 @@ pub enum InlinableExpression {
14811482
Case {
14821483
subjects: Vec<InlinableExpression>,
14831484
clauses: Vec<InlinableClause>,
1484-
compiled_case: CompiledCase,
1485+
compiled_case: Box<CompiledCase>,
14851486
type_: InlinableType,
14861487
},
14871488

@@ -1517,7 +1518,7 @@ impl InlinableExpression {
15171518
.iter()
15181519
.map(|clause| clause.to_typed_clause())
15191520
.collect(),
1520-
compiled_case: compiled_case.clone(),
1521+
compiled_case: compiled_case.as_ref().clone(),
15211522
},
15221523
InlinableExpression::Variable {
15231524
name,

compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__inlining__inline_function_with_use_becomes_tail_recursive.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function count(loop$from, loop$to) {
3535
if ($) {
3636
return from;
3737
} else {
38-
echo(from, "src/module.gleam", 6);
38+
echo(from, undefined, "src/module.gleam", 6);
3939
loop$from = from + 1;
4040
loop$to = to;
4141
}

0 commit comments

Comments
 (0)