Do not attempt to lookup functions in expects

Functions are not useful to print in expect results, because they are
only printed opaquely as `<function>`. Moreover, their transformation to
closure sets during mono can be extremely lossy, up to and including the
elision of symbols for function closure symbols. As such, simply do not
attempt to lookup or print functions referenced in expects.

Closes #4389
This commit is contained in:
Ayaz Hafiz 2022-10-24 10:28:56 -05:00
parent 50fac9cc9e
commit 5164994fb5
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
4 changed files with 77 additions and 17 deletions

View file

@ -923,13 +923,34 @@ mod test {
When it failed, these variables had these values:
forcer : Str -> U8
forcer = <function>
case : Str
case = ""
"#
),
);
}
#[test]
fn issue_i4389() {
run_expect_test(
indoc!(
r#"
interface Test exposes [] imports []
expect
totalCount = \{} -> 1u8
totalCount {} == 96u8
"#
),
indoc!(
r#"
This expectation failed:
3> expect
4> totalCount = \{} -> 1u8
5> totalCount {} == 96u8
"#
),
);
}
}