Skip to main content

rajac_types/
type_variable.rs

1use crate::TypeId;
2use rajac_base::shared_string::SharedString;
3
4#[derive(Debug, Clone, PartialEq)]
5pub struct TypeVariable {
6    pub name: SharedString,
7    pub bound: Option<TypeId>,
8}
9
10impl TypeVariable {
11    pub fn new(name: SharedString) -> Self {
12        Self { name, bound: None }
13    }
14
15    pub fn with_bound(mut self, bound: TypeId) -> Self {
16        self.bound = Some(bound);
17        self
18    }
19}