Improve error pattern and fix tests

This commit is contained in:
ayazhafiz 2022-02-27 12:01:12 -05:00
parent 75cef24ee0
commit 720b7b49d2
3 changed files with 7 additions and 7 deletions

View file

@ -196,7 +196,7 @@ pub fn canonicalize_pattern<'a>(
env.problem(Problem::RuntimeError(RuntimeError::OpaqueNotApplied(
loc_name.clone(),
)));
Pattern::OpaqueNotInScope(loc_name)
Pattern::UnsupportedPattern(region)
}
Apply(tag, patterns) => {
let mut can_patterns = Vec::with_capacity(patterns.len());

View file

@ -755,7 +755,7 @@ mod test_load {
err,
indoc!(
r#"
OPAQUE TYPE DECLARED OUTSIDE SCOPE
OPAQUE TYPE DECLARED OUTSIDE SCOPE
The unwrapped opaque type Age referenced here:
@ -769,7 +769,7 @@ mod test_load {
Note: Opaque types can only be wrapped and unwrapped in the module they are defined in!
OPAQUE TYPE DECLARED OUTSIDE SCOPE
OPAQUE TYPE DECLARED OUTSIDE SCOPE
The unwrapped opaque type Age referenced here:

View file

@ -8147,7 +8147,7 @@ I need all branches in an `if` to have the same type!
),
indoc!(
r#"
OPAQUE TYPE NOT DEFINED
OPAQUE TYPE NOT DEFINED
The opaque type Age referenced here is not defined:
@ -8172,7 +8172,7 @@ I need all branches in an `if` to have the same type!
),
indoc!(
r#"
OPAQUE TYPE NOT DEFINED
OPAQUE TYPE NOT DEFINED
The opaque type Age referenced here is not defined:
@ -8213,7 +8213,7 @@ I need all branches in an `if` to have the same type!
// Apply(Error(OtherModule), [ $Age, 21 ])
indoc!(
r#"
OPAQUE TYPE NOT APPLIED
OPAQUE TYPE NOT APPLIED
This opaque type is not applied to an argument:
@ -8263,7 +8263,7 @@ I need all branches in an `if` to have the same type!
If you didn't intend on using `Age` then remove it so future readers of
your code don't wonder why it is there.
OPAQUE TYPE NOT DEFINED
OPAQUE TYPE NOT DEFINED
The opaque type Age referenced here is not defined: