mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-11 16:51:53 +03:00
Add qualified opaque reference reporting test
This commit is contained in:
parent
90de82e295
commit
321a970215
@ -8199,4 +8199,39 @@ I need all branches in an `if` to have the same type!
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn qualified_opaque_reference() {
|
||||
report_problem_as(
|
||||
indoc!(
|
||||
r#"
|
||||
OtherModule.$Age 21
|
||||
"#
|
||||
),
|
||||
// TODO: get rid of the second error. Consider parsing OtherModule.$Age to completion
|
||||
// and checking it during can.
|
||||
indoc!(
|
||||
r#"
|
||||
── SYNTAX PROBLEM ──────────────────────────────────────────────────────────────
|
||||
|
||||
I am trying to parse a qualified name here:
|
||||
|
||||
1│ OtherModule.$Age 21
|
||||
^
|
||||
|
||||
I was expecting to see an identifier next, like height. A complete
|
||||
qualified name looks something like Json.Decode.string.
|
||||
|
||||
── OPAQUE NOT DEFINED ──────────────────────────────────────────────────────────
|
||||
|
||||
The opaque type Age referenced here is not defined:
|
||||
|
||||
1│ OtherModule.$Age 21
|
||||
^^^^
|
||||
|
||||
Note: It looks like there are no opaque types declared in this module yet!
|
||||
"#
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user