You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type '{ icon: UnfilledIconType; unfilled: boolean; }' is not assignable to type 'Icon'.
Type '{ icon: UnfilledIconType; unfilled: boolean; }' is not assignable to type 'UnfilledIcon'.
Types of property 'unfilled' are incompatible.
Type 'boolean' is not assignable to type 'true'.(2322)
π Expected behavior
Should type check without problems.
{ icon: 'icon_1' unfilled: true } would be a valid UnfilledIcon, and { icon: 'icon_1' unfilled: false } would be a valid FilledIcon.
Additional information about the issue
This only seems to happen if UnfilledIconType has more than 12 literals. Removing icon_13 causes the type check to succeed.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
π Search Terms
"12 limit union type", "union type subtyping literals"
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?ts=5.8.0-dev.20250123#code/C4TwDgpgBAYglgGwRAJgSQMYHsB2UC8UA3gFBTlRzY4BcUAzsAE5w4DmZFArjgGaLIUAfjq8AhgnrQSAXxIlQkKAFU+A1JlwAVcNEKdyAHygByKrgD6ARhNQDUY2eoWATCfuPzOCwGZ3FB1MvCwAWfwpPZwBWcKMg5wA2WMCnSwB2ZMjLAA5M+MsATjzU7ysABmLgqxsPfNK3WpLrP3lFaFV+JA1qAmJ7LzoO9XRqHUh7Hk7BOmYuCFlW3ShNPEJ4LpHcQKGNlfleHgxgOC2MJggxYAgVgAoBlTVd0d0AGihJ4boAIywsZDEcABKKB0FZ9ALnYBcJh4UgBAJeF72AIfDb2ORyIA
π» Code
π Actual behavior
Typescript reports the following error:
π Expected behavior
Should type check without problems.
{ icon: 'icon_1' unfilled: true }
would be a validUnfilledIcon
, and{ icon: 'icon_1' unfilled: false }
would be a validFilledIcon
.Additional information about the issue
This only seems to happen if
UnfilledIconType
has more than 12 literals. Removingicon_13
causes the type check to succeed.The text was updated successfully, but these errors were encountered: