nac3core: fix assign to constant

This commit is contained in:
ychenfo 2022-03-24 07:13:13 +08:00
parent ec52128a4a
commit be75fa7368
1 changed files with 3 additions and 0 deletions

View File

@ -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),
}
}