Skip to content

Nullable.fromOption does not return null for None #170

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

Closed
jquesada2016 opened this issue Dec 14, 2023 · 3 comments
Closed

Nullable.fromOption does not return null for None #170

jquesada2016 opened this issue Dec 14, 2023 · 3 comments

Comments

@jquesada2016
Copy link

None->Nullable.fromOption

should return null, but instead returns undefined, which is not the same. :(

@zth
Copy link
Collaborator

zth commented Jan 4, 2024

This is actually intended. Maybe it's the naming that's a bit confusing, but Null.t and Null.fromOption would return null for None. Nullable has both undefined and null.

Closing since it's working as intended, but please feel free to continue the discussion.

@zth zth closed this as completed Jan 4, 2024
@DZakh
Copy link
Member

DZakh commented Jan 4, 2024

Related to rescript-lang/rescript#6533

@jquesada2016
Copy link
Author

Yes, this was exactly what got me. The nullable name made me assume it returned null, rather than it being a nomenclature fore both null and undefined coercing to undefined. I also thought null only defined the null constant value. I hadn't noticed Null.t<'a>.

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

No branches or pull requests

3 participants