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

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