Patch Changes
-
#4798
239cc99
Thanks @gcanti! - Schema: respect custom constructors inmake
forSchema.Class
, closes #4797Previously, the
make
method did not support custom constructors defined usingSchema.Class
orSchema.TaggedError
, resulting in type errors when passing custom constructor arguments.This update ensures that
make
now correctly uses the class constructor, allowing custom parameters and initialization logic.Before
import { Schema } from "effect" class MyError extends Schema.TaggedError<MyError>()("MyError", { message: Schema.String }) { constructor({ a, b }: { a: string; b: string }) { super({ message: `${a}:${b}` }) } } // @ts-expect-error: Object literal may only specify known properties, and 'a' does not exist in type '{ readonly message: string; }'.ts(2353) MyError.make({ a: "1", b: "2" })
After
import { Schema } from "effect" class MyError extends Schema.TaggedError<MyError>()("MyError", { message: Schema.String }) { constructor({ a, b }: { a: string; b: string }) { super({ message: `${a}:${b}` }) } } console.log(MyError.make({ a: "1", b: "2" }).message) // Output: "1:2"
-
#4687
8b6c947
Thanks @KhraksMamtsov! - Modify the signatures ofEither.liftPredicate
andEffect.predicate
to make them reusable. -
#4794
c50a63b
Thanks @IGassmann! - Fix summary metric’s quantile value calculation