keep-starknet-strange / cairo-lint

A collection of lints to catch common mistakes and improve your Cairo code.
21 stars 35 forks source link

bug : manual lint panic when match expression is a function #124

Open chachaleo opened 2 months ago

chachaleo commented 2 months ago

Manual lint fails when the expression in the ExprMatch is a function

Example :

#[derive(Copy, Drop)]
enum Error {
    Error,
}
fn main() {
    let self: u256 = 0; 
    let _self_result: Result<u8, Error> = match self.try_into() {
        Option::Some(value) => Result::Ok(value),
        Option::None => Result::Err(Error::Error)
    };
}

panics with Expected a variable or path in match expression, because self.try_into() is a function and the lint does not support it currently in the fix function