diff --git a/nac3core/src/typecheck/function_check.rs b/nac3core/src/typecheck/function_check.rs index 26fa0c40..b23821ae 100644 --- a/nac3core/src/typecheck/function_check.rs +++ b/nac3core/src/typecheck/function_check.rs @@ -46,6 +46,9 @@ impl<'a> Inferencer<'a> { } Ok(()) } + ExprKind::Constant { .. } => { + Err(format!("cannot assign to a constant (at {})", pattern.location)) + } _ => self.check_expr(pattern, defined_identifiers), } }