-
-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Match no longer compatible with identity #4556
Comments
That PR didn't touch the .when signature, so I think the cause must be something else 🤔 |
I spent some time trying to debug, but I couldn't isolate the change that caused the failure. It's working fine with |
@thewilkybarkid I get the same error with |
Looking at it closer, my reproduction isn't right: when using |
Works in import { identity, Match, pipe } from "effect"
type Foo = { _tag: 'foo' }
type Bar = { _tag: 'bar' }
const withIdentity: (u: Foo | Bar) => Foo | "baz" = pipe(
Match.type<Foo | Bar>(),
Match.tag("foo", identity),
Match.tag("bar", () => "baz" as const),
Match.exhaustive
)
const withoutIdentity: (u: Foo | Bar) => Foo | "baz" = pipe(
Match.type<Foo | Bar>(),
Match.tag("foo", (value) => value),
Match.tag("bar", () => "baz" as const),
Match.exhaustive
) |
What version of Effect is running?
3.13.6
What steps can reproduce the bug?
https://effect.website/play#8b9250181318
What is the expected behavior?
Both are assignable.
What do you see instead?
withIdentity
has a type error:Additional information
PREreview/prereview.org#2279 is failing, as some of our matchers now have an inferred return type of
unknown
(e.g. https://github.com/PREreview/prereview.org/blob/59804ce6fc1f444f0fa4ed579a94d01af6d1c6d1/src/Comments/Evolve.ts#L5-L17)Could be related to #4530
The text was updated successfully, but these errors were encountered: