about summary refs log blame commit diff
path: root/users/aspen/achilles/src/interpreter/error.rs
blob: 268d6f479a1ec1d06d27fa0e64358fdee33e8d6f (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                  



                                


                                              
use std::result;

use thiserror::Error;

use crate::ast::{Ident, Type};

#[derive(Debug, PartialEq, Eq, Error)]
pub enum Error {
    #[error("Undefined variable {0}")]
    UndefinedVariable(Ident<'static>),

    #[error("Unexpected type {actual}, expected type {expected}")]
    InvalidType {
        actual: Type<'static>,
        expected: Type<'static>,
    },
}

pub type Result<T> = result::Result<T, Error>;