Show the right fct name in type error messages

This commit is contained in:
jecaro 2023-11-16 16:44:55 +01:00
parent 7b1f2d2ac1
commit c858031f74
No known key found for this signature in database
GPG key ID: 3AEB4D2AFA2ACD45
6 changed files with 125 additions and 13 deletions

View file

@ -102,6 +102,15 @@ pub enum UnaryOp {
Not,
}
impl std::fmt::Display for UnaryOp {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
UnaryOp::Negate => write!(f, "-"),
UnaryOp::Not => write!(f, "!"),
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BinOp {
// highest precedence