Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

consTrue and constFalse both return a boolean instead of the respective narrow types #1749

Open
vecerek opened this issue Aug 25, 2022 · 0 comments 路 May be fixed by #1750
Open

consTrue and constFalse both return a boolean instead of the respective narrow types #1749

vecerek opened this issue Aug 25, 2022 · 0 comments 路 May be fixed by #1750

Comments

@vecerek
Copy link
Sponsor

vecerek commented Aug 25, 2022

馃悰 Bug report

Current Behavior

constTrue and constFalse are functions that both lazily return a boolean instead of true and false types, respectively.

Expected behavior

I expect constTrue() to return true of type true and constFalse() to return false of type false.

Reproducible example

import { constFalse, constTrue } from "fp-ts/function";

const myFn = (): true => constTrue(); // TS(2322): Type 'boolean' is not assignable to type 'true'.

Suggested solution(s)

Additional context

Your environment

Which versions of fp-ts are affected by this issue? Did this work in previous versions of fp-ts?

Software Version(s)
fp-ts master
TypeScript >= 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant