diff --git a/crates/cairo-lang-lowering/src/diagnostic.rs b/crates/cairo-lang-lowering/src/diagnostic.rs index 308216c7ef2..aa91eaf6720 100644 --- a/crates/cairo-lang-lowering/src/diagnostic.rs +++ b/crates/cairo-lang-lowering/src/diagnostic.rs @@ -1,6 +1,7 @@ use cairo_lang_defs::diagnostic_utils::StableLocation; use cairo_lang_diagnostics::{ DiagnosticAdded, DiagnosticEntry, DiagnosticLocation, DiagnosticNote, DiagnosticsBuilder, + Severity, }; use cairo_lang_semantic as semantic; use cairo_lang_semantic::corelib::LiteralError; @@ -84,6 +85,13 @@ impl DiagnosticEntry for LoweringDiagnostic { } } + fn severity(&self) -> Severity { + match self.kind { + LoweringDiagnosticKind::Unreachable { .. } => Severity::Warning, + _ => Severity::Error, + } + } + fn notes(&self, _db: &Self::DbType) -> &[DiagnosticNote] { &self.location.notes } diff --git a/crates/cairo-lang-lowering/src/test_data/tests b/crates/cairo-lang-lowering/src/test_data/tests index 18ebb8df849..addaea04b74 100644 --- a/crates/cairo-lang-lowering/src/test_data/tests +++ b/crates/cairo-lang-lowering/src/test_data/tests @@ -45,7 +45,7 @@ foo //! > semantic_diagnostics //! > lowering_diagnostics -error: Unreachable code +warning: Unreachable code --> lib.cairo:3:5 5; ^^