import { Schema as S } from "effect";
const withB = <Fields extends S.Struct.Fields, S extends S.Struct<Fields>>(s: S) => {
return S.extend(s, S.Struct({ b: S.String }));
};
const A = S.Struct({ b: S.String });
const B = withB(A);
// src/main.ts(8,17): error TS2345: Argument of type 'Struct<{ b: typeof String$; }>' is not assignable to parameter of type 'Struct<Fields>'.
// Types of property 'annotations' are incompatible.
console.log(B.make({
a: "a",
b: "b"
}))
import { Schema as S } from "effect";
const withB = <Fields extends S.Struct.Fields, S extends S.Struct<Fields>>(s: S) => {
return S.extend(s, S.Struct({ b: S.String }));
};
const A = S.Struct({ b: S.String });
const B = withB(A);
// src/main.ts(8,17): error TS2345: Argument of type 'Struct<{ b: typeof String$; }>' is not assignable to parameter of type 'Struct<Fields>'.
// Types of property 'annotations' are incompatible.
console.log(B.make({
a: "a",
b: "b"
}))