1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use debris_common::Span;
use debris_error::{LangError, LangErrorKind, SingleCompileError};

use crate::class::Class;

#[track_caller]
pub fn unexpected_type(span: Span, expected: &Class, actual: &Class) -> SingleCompileError {
    LangError::new(
        LangErrorKind::UnexpectedType {
            got: actual.to_string(),
            expected: vec![expected.to_string()],
            declared: None,
        },
        span,
    )
    .into()
}