From Discord: Issue with Generic Tagged Enum Type in Effect Playground Link
Summary
The user "denishsharma" is experiencing an issue with a generic tagged enum type in the Effect Typescript library, specifically within an Effect Playground link they provided. The problem is that a type, which should be inferred as a number, is instead being inferred as any. This issue seems to be linked to a regression introduced by a recent pull request (PR #4497) to the Effect library, as pointed out by "fubhy". The PR changed the default type from unknown to any for WithGenerics, which is why the type inference is defaulting to any. "denishsharma" is seeking a workaround, mentioning they are currently using satisfies, and notes that the type inference was functioning correctly a few weeks ago.
Key Takeaways:
- A regression was introduced in PR #4497, causing incorrect type inference in a generic tagged enum.
- The change from
unknowntoanyforWithGenericsin the PR is identified as the cause. - A workaround involving
satisfiesis currently in use. - The issue has been recent, as it was working a few weeks ago.
Discord thread
https://discord.com/channels/795981131316985866/1355672545516585072