mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
hook up TypeError
This commit is contained in:
parent
6531845966
commit
14ad793bd7
18 changed files with 216 additions and 63 deletions
|
@ -37,6 +37,13 @@ impl<T> PExpected<T> {
|
|||
PExpected::ForReason(_, val, _) => val,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn replace<U>(self, new: U) -> PExpected<U> {
|
||||
match self {
|
||||
PExpected::NoExpectation(_val) => PExpected::NoExpectation(new),
|
||||
PExpected::ForReason(reason, _val, region) => PExpected::ForReason(reason, new, region),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Expected<T> {
|
||||
|
@ -63,4 +70,14 @@ impl<T> Expected<T> {
|
|||
Expected::FromAnnotation(_, _, _, val) => val,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn replace<U>(self, new: U) -> Expected<U> {
|
||||
match self {
|
||||
Expected::NoExpectation(_val) => Expected::NoExpectation(new),
|
||||
Expected::ForReason(reason, _val, region) => Expected::ForReason(reason, new, region),
|
||||
Expected::FromAnnotation(pattern, size, source, _val) => {
|
||||
Expected::FromAnnotation(pattern, size, source, new)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue