What version of Effect is running?
3.14.1
What steps can reproduce the bug?
import { Cause } from "effect";
const cause = Cause.fail("Error");
console.log(cause);
if (Cause.isFailType(cause)) {
// console.log(cause.failure); <-- does not type check
console.log(cause.error);
}
The console.log(cause) prints the following
{ _id: 'Cause', _tag: 'Fail', failure: 'Error' }
Indicating that there should be a failure property on the cause object. But in reality there is none as can be seen in the if statement. There is a error property though.
What is the expected behavior?
I was expecting that what the console.log emitted should correspond to the structure of the cause object.
What do you see instead?
The console.log(cause) indicates that there is a failure property on the cause object, when there in fact is no such property.
Additional information
I believe this are due to the toJSON implementation for the Cause.Fail in effect/src/internal/cause.ts.
What version of Effect is running?
3.14.1
What steps can reproduce the bug?
The
console.log(cause)prints the followingIndicating that there should be a
failureproperty on thecauseobject. But in reality there is none as can be seen in the if statement. There is aerrorproperty though.What is the expected behavior?
I was expecting that what the
console.logemitted should correspond to the structure of thecauseobject.What do you see instead?
The
console.log(cause)indicates that there is afailureproperty on thecauseobject, when there in fact is no such property.Additional information
I believe this are due to the
toJSONimplementation for theCause.Failineffect/src/internal/cause.ts.