about summary refs log tree commit diff
path: root/src/interpreter/error.rs
blob: 268d6f479a1ec1d06d27fa0e64358fdee33e8d6f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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>;