export class Inner extends Schema.Class<Inner>("Inner")( { value: Schema.Literal("ok") }) {}export class Outer extends Schema.Class<Outer>("Outer")( { inner: Inner }) {}Outer.make({ inner: { value: "ok" as const } // This is not a correct class but structucally matches})
export class Inner extends Schema.Class<Inner>("Inner")( { value: Schema.Literal("ok") }) {}export class Outer extends Schema.Class<Outer>("Outer")( { inner: Inner }) {}Outer.make({ inner: { value: "ok" as const } // This is not a correct class but structucally matches})
Basically I want to make
Outer
Outer
with
make
make
by just passing it the correct structure and not necessarily a class instance. Is this possible? (in the real use case there are many classes and they are nested) We've been using the Schema.Class as a replacement for Struct but recently been getting many cases similar to this where it simply doesn't work and isn't caught by the typesystem. Is this even a valid usecase of Schema.Class and if not could anyone advise what is the usecase of the class?