mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
initial solver for the editor's type constraints
This commit is contained in:
parent
f16d1619ea
commit
bffb9ab6fe
7 changed files with 1625 additions and 4 deletions
|
@ -89,4 +89,16 @@ impl<T> Expected<T> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn replace_ref<U>(&self, new: U) -> Expected<U> {
|
||||
match self {
|
||||
Expected::NoExpectation(_val) => Expected::NoExpectation(new),
|
||||
Expected::ForReason(reason, _val, region) => {
|
||||
Expected::ForReason(reason.clone(), new, *region)
|
||||
}
|
||||
Expected::FromAnnotation(pattern, size, source, _val) => {
|
||||
Expected::FromAnnotation(pattern.clone(), *size, *source, new)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue