Add qualified opaque reference reporting test

This commit is contained in:
ayazhafiz 2022-02-21 18:32:23 -05:00
parent 90de82e295
commit 321a970215

View File

@ -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!
"#
),
)
}
}