knave 0.14.11

A Lisp programming language for humans and agents that infers types and ownership and compiles to readable Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::problems::MismatchContext;
use super::ty::Type;

pub(super) struct Expectation<'a> {
    pub(super) expected: &'a Type,
    pub(super) context: MismatchContext,
}

impl<'a> Expectation<'a> {
    pub(super) fn new(expected: &'a Type, context: MismatchContext) -> Self {
        Self { expected, context }
    }

    pub(super) fn plain(expected: &'a Type) -> Self {
        Self::new(expected, MismatchContext::Plain)
    }
}