-
-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Oliver Joseph Ash <oliverjash@gmail.com>
- Loading branch information
1 parent
b00f7a0
commit 5266b6c
Showing
4 changed files
with
556 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"effect": patch | ||
--- | ||
|
||
Improve DX of type errors from inside `pipe` and `flow` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { identity, Option } from "effect" | ||
import { flow, pipe } from "effect/Function" | ||
|
||
// We should only have one error for the missing definition. | ||
const _x = (): number => | ||
pipe( | ||
1, | ||
// @ts-expect-error | ||
add(1), | ||
identity | ||
) | ||
|
||
// We should only have one error for the missing definition. | ||
const _y = (): (n: number) => number => | ||
flow( | ||
// @ts-expect-error | ||
add(1), | ||
identity | ||
) | ||
|
||
// We should only have one error for the missing definition. | ||
const _z = (): number => | ||
Option.some(1).pipe( | ||
// @ts-expect-error | ||
add(1), | ||
identity | ||
) |
Oops, something went wrong.