mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
Improve error pattern and fix tests
This commit is contained in:
parent
75cef24ee0
commit
720b7b49d2
3 changed files with 7 additions and 7 deletions
|
@ -196,7 +196,7 @@ pub fn canonicalize_pattern<'a>(
|
||||||
env.problem(Problem::RuntimeError(RuntimeError::OpaqueNotApplied(
|
env.problem(Problem::RuntimeError(RuntimeError::OpaqueNotApplied(
|
||||||
loc_name.clone(),
|
loc_name.clone(),
|
||||||
)));
|
)));
|
||||||
Pattern::OpaqueNotInScope(loc_name)
|
Pattern::UnsupportedPattern(region)
|
||||||
}
|
}
|
||||||
Apply(tag, patterns) => {
|
Apply(tag, patterns) => {
|
||||||
let mut can_patterns = Vec::with_capacity(patterns.len());
|
let mut can_patterns = Vec::with_capacity(patterns.len());
|
||||||
|
|
|
@ -755,7 +755,7 @@ mod test_load {
|
||||||
err,
|
err,
|
||||||
indoc!(
|
indoc!(
|
||||||
r#"
|
r#"
|
||||||
── OPAQUE TYPE DECLARED OUTSIDE SCOPE ───────────────────────────────────────────────
|
── OPAQUE TYPE DECLARED OUTSIDE SCOPE ──────────────────────────────────────────
|
||||||
|
|
||||||
The unwrapped opaque type Age referenced here:
|
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!
|
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:
|
The unwrapped opaque type Age referenced here:
|
||||||
|
|
||||||
|
|
|
@ -8147,7 +8147,7 @@ I need all branches in an `if` to have the same type!
|
||||||
),
|
),
|
||||||
indoc!(
|
indoc!(
|
||||||
r#"
|
r#"
|
||||||
── OPAQUE TYPE NOT DEFINED ──────────────────────────────────────────────────────────
|
── OPAQUE TYPE NOT DEFINED ─────────────────────────────────────────────────────
|
||||||
|
|
||||||
The opaque type Age referenced here is 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!(
|
indoc!(
|
||||||
r#"
|
r#"
|
||||||
── OPAQUE TYPE NOT DEFINED ──────────────────────────────────────────────────────────
|
── OPAQUE TYPE NOT DEFINED ─────────────────────────────────────────────────────
|
||||||
|
|
||||||
The opaque type Age referenced here is 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 ])
|
// Apply(Error(OtherModule), [ $Age, 21 ])
|
||||||
indoc!(
|
indoc!(
|
||||||
r#"
|
r#"
|
||||||
── OPAQUE TYPE NOT APPLIED ──────────────────────────────────────────────────────────
|
── OPAQUE TYPE NOT APPLIED ─────────────────────────────────────────────────────
|
||||||
|
|
||||||
This opaque type is not applied to an argument:
|
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
|
If you didn't intend on using `Age` then remove it so future readers of
|
||||||
your code don't wonder why it is there.
|
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:
|
The opaque type Age referenced here is not defined:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue