effect icon indicating copy to clipboard operation
effect copied to clipboard

Regression: `catchTag` breaks contextual argument type inference for `Effect.fnUntraced` when piping

Open jfet97 opened this issue 6 months ago • 0 comments

What version of Effect is running?

3.16.8

What steps can reproduce the bug?

class Error1 extends Data.TaggedError("error1") {
}

class Error2 extends Data.TaggedError("error2") {
}

declare const eff: Effect<void, Error1 | Error2>

pipe(
  eff,
  Effect.catchTag(
    "error1",
    Effect.fnUntraced(function*(err) {
      console.log("error1", err)
    })
  )
)

What is the expected behavior?

err must have type Error1

What do you see instead?

err has type any

Additional information

Repro: https://effect.website/play#a03fc9e50f0d It is a regression, was fine with Effect 3.14.20.

jfet97 avatar Jun 23 '25 14:06 jfet97