feat: annotated data for option datum
This commit is contained in:
@@ -22,6 +22,8 @@ mod pattern;
|
||||
mod pipe;
|
||||
pub mod pretty;
|
||||
|
||||
pub use environment::collapse_links;
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct TypeAliasAnnotation {
|
||||
pub alias: String,
|
||||
@@ -1099,13 +1101,11 @@ impl TypeVar {
|
||||
Self::Link { tipo } => tipo.get_inner_types(),
|
||||
Self::Unbound { .. } => vec![],
|
||||
var => {
|
||||
vec![
|
||||
Type::Var {
|
||||
tipo: RefCell::new(var.clone()).into(),
|
||||
alias: None,
|
||||
}
|
||||
.into(),
|
||||
]
|
||||
vec![Type::Var {
|
||||
tipo: RefCell::new(var.clone()).into(),
|
||||
alias: None,
|
||||
}
|
||||
.into()]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1967,7 +1967,7 @@ pub(super) fn assert_no_labeled_arguments<A>(args: &[CallArg<A>]) -> Option<(Spa
|
||||
None
|
||||
}
|
||||
|
||||
pub(super) fn collapse_links(t: Rc<Type>) -> Rc<Type> {
|
||||
pub fn collapse_links(t: Rc<Type>) -> Rc<Type> {
|
||||
if let Type::Var { tipo, alias } = t.deref() {
|
||||
if let TypeVar::Link { tipo } = tipo.borrow().deref() {
|
||||
return Type::with_alias(tipo.clone(), alias.clone());
|
||||
|
||||
Reference in New Issue
Block a user