Join Nostr
2025-01-22 10:41:52 UTC

Axel Rauschmayer on Nostr: #TypeScript: I don’t think TColor being Color can be avoided(?) class Color { ...

#TypeScript: I don’t think TColor being Color can be avoided(?)

class Color {
static red = new Color();
static green = new Color();
static blue = new Color();
}
type TColor = typeof Color.red | typeof Color.green | typeof Color.red;

Even adding a private slot to make Color nominal doesn’t change anything.