Effect CommunityEC
Effect Community2y ago
5 replies
leonitous

Issues with Recursive Type References in TypeScript

trying to attach an example annotation to a class makes typescript upset:

// Type 'A' recursively references itself as a base type. ts(2310)
// 'A' is referenced directly or indirectly in its own base expression. ts(2506)
export class A extends Schema.Class<A>("A")(
    {
        a: Schema.String,
    },
    {
        examples: [{ a: "aaaaaaah" }],
    }
) {}


are there any other ways to attach annotations to a class schemas?
Was this page helpful?