1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use std::ops::Deref;

use super::abc::Type;


#[derive(Debug)]
pub struct BType(
    pub Box<Type>
);

impl Into<BType> for Box<Type> {
    fn into(self) -> BType {
        BType(self)
    }
}

impl <T> From<T> for BType where T: Type + 'static {
    fn from(b: T) -> Self {
        BType(box b)
    }
}

impl Deref for BType {
    type Target = Box<Type>;

    fn deref(&self) -> &Self::Target {
        &self.0
    }
}

impl Clone for BType {
    fn clone(&self) -> Self {
        self.iclone()
    }
}