mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-23 06:10:02 +08:00
* Expand static Effect support across common APIs * Preserve compiler parity across expanded Effect patterns * Fix compiler regressions exposed by Effect coverage * Bound shared type conversion traversal * Clarify conversion contracts and tidy fixtures * Run every Effect fixture in CI shards * Preserve inferred array assignments in concurrent Effect programs * Record inferred array fixture compiler ordering
14 lines
441 B
JavaScript
14 lines
441 B
JavaScript
function make(tag) {
|
|
class Failure extends Error {
|
|
_tag = tag;
|
|
}
|
|
return Failure;
|
|
}
|
|
const Left = make("Left");
|
|
const Right = make("Right");
|
|
function construct(Type, message) { return new Type(message); }
|
|
const left = construct(Left, "first");
|
|
const right = construct(Right, "second");
|
|
console.log(left._tag, left.message, right._tag, right.message);
|
|
console.log(left instanceof Left, right instanceof Right, left instanceof Right);
|