Get the free type variable controlling this one.
(&self)
| 131 | |
| 132 | /// Get the free type variable controlling this one. |
| 133 | pub fn free_typevar(&self) -> Option<TypeVar> { |
| 134 | match &self.base { |
| 135 | Some(base) => base.type_var.free_typevar(), |
| 136 | None => { |
| 137 | match self.singleton_type() { |
| 138 | // A singleton type isn't a proper free variable. |
| 139 | Some(_) => None, |
| 140 | None => Some(self.clone()), |
| 141 | } |
| 142 | } |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | /// Create a type variable that is a function of another. |
| 147 | pub fn derived(&self, derived_func: DerivedFunc) -> TypeVar { |
no test coverage detected