forge_lint/sol/info/
low_level_calls.rs1use super::LowLevelCalls;
2use crate::{
3 linter::{EarlyLintPass, LintContext},
4 sol::{Severity, SolLint, analysis::is_low_level_call},
5};
6use solar::ast::Expr;
7
8declare_forge_lint!(
9 LOW_LEVEL_CALLS,
10 Severity::Info,
11 "low-level-calls",
12 "low-level call bypasses type checking"
13);
14
15impl<'ast> EarlyLintPass<'ast> for LowLevelCalls {
16 fn check_expr(&mut self, ctx: &LintContext, expr: &'ast Expr<'ast>) {
17 if is_low_level_call(expr) {
18 ctx.emit(&LOW_LEVEL_CALLS, expr.span);
19 }
20 }
21}