Files
scriptc/tests/corpus/class-curried-factory.mjs
T
Chris Tate 2069684b40 Expand static Effect support across common APIs (#598)
* 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
2026-10-01 02:49:31 -05:00

22 lines
768 B
JavaScript

function Base(props) { Object.assign(this, props); }
const makeClass = ({ Base, label }) => {
const key = Symbol.for(label);
const Result = class extends Base {
constructor(props) { super(props); }
get [key]() { return label; }
};
Object.defineProperty(Result.prototype, "describe", {
value() { return label + ":" + this.value; },
configurable: true,
writable: true,
});
return Result;
};
const factory = label => () => makeClass({ Base, label });
class First extends factory("first")() {}
class Second extends factory("second")() {}
const first = new First({ value: 42 });
const second = new Second({ value: 7 });
console.log(first.describe(), second.describe());
console.log(first[Symbol.for("first")], second[Symbol.for("second")]);