What Git revision are you using?
5538a42b
What operating system are you using, and which version?
Describe what the problem is?
A user trace wrapped around a helper call can erase a typed expect failure raised inside that helper when --trace-filter compiler-generated is used.
trace @"user trace": helper(bad_data()) behaves differently from helper(bad_data()) when the helper contains expect dat: MyDatum<Int> = d. Under --trace-filter compiler-generated, the plain helper call still fails and passes a fail test, but the traced helper call no longer reaches the typed expect failure, so the fail-marked test fails instead.
Reproduction:
use aiken/builtin
pub type MyDatum<a> {
Constructor1(a)
Constructor2
}
fn bad_data() -> Data {
builtin.constr_data(0, [builtin.b_data(#"aa")])
}
fn helper(d: Data) -> Bool {
expect dat: MyDatum<Int> = d
when dat is {
Constructor1(_) -> True
_ -> False
}
}
test plain_helper_typed_expect() fail {
helper(bad_data())
}
test traced_helper_typed_expect() fail {
trace @"user trace": helper(bad_data())
}
Running:
aiken check . --seed 1 --max-success 1 --trace-level verbose --trace-filter compiler-generated
plain_helper_typed_expect passes as an expected failure, while traced_helper_typed_expect fails the test. This extends the previously observed typed Data cast trace-filter behavior beyond a trace wrapped directly around the expect expression.
What should be the expected behavior?
--trace-filter compiler-generated should only filter which traces are emitted; it should not change evaluation semantics. The traced helper call (trace @"user trace": helper(bad_data())) should still reach the typed expect failure inside helper, so traced_helper_typed_expect should pass as an expected failure, matching the behavior of the plain helper(bad_data()) call in plain_helper_typed_expect.
What Git revision are you using?
5538a42bWhat operating system are you using, and which version?
Describe what the problem is?
A user trace wrapped around a helper call can erase a typed
expectfailure raised inside that helper when--trace-filter compiler-generatedis used.trace @"user trace": helper(bad_data())behaves differently fromhelper(bad_data())when the helper containsexpect dat: MyDatum<Int> = d. Under--trace-filter compiler-generated, the plain helper call still fails and passes afailtest, but the traced helper call no longer reaches the typed expect failure, so the fail-marked test fails instead.Reproduction:
Running:
aiken check . --seed 1 --max-success 1 --trace-level verbose --trace-filter compiler-generatedplain_helper_typed_expectpasses as an expected failure, whiletraced_helper_typed_expectfails the test. This extends the previously observed typed Data cast trace-filter behavior beyond a trace wrapped directly around theexpectexpression.What should be the expected behavior?
--trace-filter compiler-generatedshould only filter which traces are emitted; it should not change evaluation semantics. The traced helper call (trace @"user trace": helper(bad_data())) should still reach the typedexpectfailure insidehelper, sotraced_helper_typed_expectshould pass as an expected failure, matching the behavior of the plainhelper(bad_data())call inplain_helper_typed_expect.