const Letter = S.Literal("A", "B", "C")
type Foo = {
letter: typeof Letter.Type
}
const foo: Foo = {
letter: "A",
}
const nextFoo: Foo = Struct.evolve(foo, {
letter: () => "B",
})
// Diagnostics:
// 1. Type '{ letter: string; }' is not assignable to type 'Foo'.
// Types of property 'letter' are incompatible.
// Type 'string' is not assignable to type '"A" | "B" | "C"'. [2322]
const Letter = S.Literal("A", "B", "C")
type Foo = {
letter: typeof Letter.Type
}
const foo: Foo = {
letter: "A",
}
const nextFoo: Foo = Struct.evolve(foo, {
letter: () => "B",
})
// Diagnostics:
// 1. Type '{ letter: string; }' is not assignable to type 'Foo'.
// Types of property 'letter' are incompatible.
// Type 'string' is not assignable to type '"A" | "B" | "C"'. [2322]