effect icon indicating copy to clipboard operation
effect copied to clipboard

From Discord: Issue with Generic Tagged Enum Type in Effect Playground Link

Open effect-bot opened this issue 9 months ago • 0 comments

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:

  1. A regression was introduced in PR #4497, causing incorrect type inference in a generic tagged enum.
  2. The change from unknown to any for WithGenerics in the PR is identified as the cause.
  3. A workaround involving satisfies is currently in use.
  4. The issue has been recent, as it was working a few weeks ago.

Discord thread

https://discord.com/channels/795981131316985866/1355672545516585072

effect-bot avatar Mar 29 '25 23:03 effect-bot