Skip to content

Commit

Permalink
Merge pull request #188 from stargazing-dino/replace_let_else
Browse files Browse the repository at this point in the history
  • Loading branch information
janhohenheim authored Apr 28, 2024
2 parents 3e33157 + 95270c8 commit 1d5ccba
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions crates/compiler/src/visitors/type_check_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,12 +437,8 @@ impl<'input> YarnSpinnerParserVisitorCompat<'input> for TypeCheckVisitor<'input>
}

fn visit_set_statement(&mut self, ctx: &Set_statementContext<'input>) -> Self::Return {
let Some(variable_context) = ctx.variable() else {
return None;
};
let Some(expression_context) = ctx.expression() else {
return None;
};
let variable_context = ctx.variable()?;
let expression_context = ctx.expression()?;
let variable_type = self.visit(variable_context.as_ref());
if let Some(variable_type) = variable_type.as_ref() {
// giving the expression a hint just in case it is needed to help resolve any ambiguity on the expression
Expand Down

0 comments on commit 1d5ccba

Please sign in to comment.