lisette-semantics 0.3.3

Little language inspired by Rust that compiles to Go
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::passes::walk::NodeCtx;
use syntax::ast::Expression;

pub fn check_empty_match_arm(expression: &Expression, ctx: &NodeCtx) {
    let Expression::Match { arms, .. } = expression else {
        return;
    };

    for arm in arms {
        if let Expression::Block { items, span, .. } = &*arm.expression
            && items.is_empty()
        {
            ctx.sink.push(diagnostics::lint::empty_match_arm(span));
        }
    }
}