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
I guess this should only have observable effects up to the extent that SomeEnum and SomeEnum.APPLE | SomeEnum.ORANGE | SomeEnum.BANANA are distinguishable.
Exactly when to perform subtype reduction is tricky business; there are some compromises we have to make in order for other scenarios to work. "Consistent" type display between different ways of generating observably-same types isn't something we can guarantee.
TypeScript Version: [email protected] (same with 3.2.4, 3.5.2, 3.5.3)
Search Terms: enum hover ternary union merging
enum subtype reduction
getUnionType
Code
Expected behavior:
All declared variables have the type
SomeEnum
or at least are consistently "wrong" (seeconst c
as showingAPPLE
)Playground Link:
https://www.typescriptlang.org/play/#code/KYOwrgtgBAyg9hYBRc0DeAoKUCCAFPAGSSgF4oByfIpCgGiygHkAlHAOQHETyLWPu9RgCEOYspVHsxFDAF8MGAGZgQAYwAuASzggoG4AGcNACi0gADmA0pIAWWAQARsABOALlgJkqAJRRMbAB6IKgAYThXV2BNABsATygAcy0ANyMoAAM1XWMoAENPeERbCEzGHJA8wq8S1AA6KXEAH1qfSAlzKxtUB2c3AG5FYNCASXVI6LjElPTDLMq8pyLvUvrqYihW4vayityNKCcJO3yNAAt613yQABMEE38AHigABnqAVigAfja1jZIni61lKfRcriGjBCUHGOSiMQ0CWSaQy2QOUDUKzqkHWBE221WqEyUBMAHdgFpXLdfPsqoc1CczpdrncHs83p8fn8GvwuICoMCevZHODISMYRN4dNkXMFujbljdo0xNIttzIOVsItDrdGRcrjd7hBHlAXu8vr8dmsmqqgZYQb0RYN5BggA
This is a really minor issue as it only applies to hover type information and the reported value while being weird isn't breaking anything.
The text was updated successfully, but these errors were encountered: