- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.1k
Closed as not planned
Closed as not planned
Copy link
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
🔎 Search Terms
ts(2590), Expression produces a union type that is too complex to represent., HexTypes
🕗 Version & Regression Information
This is an error that typescript throws when I try to build it, as well as the LSP complains. It raises the error ts(2590), Expression produces a union type that is too complex to represent
⏯ Playground Link
💻 Code
type HexChar = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "A" | "B" | "C" | "D" | "E" | "F";
type Hex3Color = `#${HexChar}${HexChar}${HexChar}`;
type Hex6Color = `#${HexChar}${HexChar}${HexChar}${HexChar}${HexChar}${HexChar}`;
type Hex8Color = `#${HexChar}${HexChar}${HexChar}${HexChar}${HexChar}${HexChar}${HexChar}${HexChar}`;
export type HexColor = Hex3Color | Hex6Color | Hex8Color;🙁 Actual behavior
The type of HexColor should be well defined and accessible. As well as there shouldn't be any errors.
🙂 Expected behavior
The type of HexColor is any, and there are errors.
Additional information about the issue
It seems that also Deno is affected (I first discovered it using Deno). I tried switching to plain TS, still raises errors.
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created