-
Notifications
You must be signed in to change notification settings - Fork 114
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
typescript bindings & strict null checks #83
Comments
Good point @emmanueltouzery , but I have to think about it for a while. Current implementation of This also means we'll have to add typings tests for both scenarios (with |
hmm maybe there is a misunderstanding. if we write for instance In the default TS mode, So the null & undefined annotations are required for proper strict null checks operation, but they don't have any effect on the default typescript operation. So:
helps in the strict null checks mode.. but has no effect on the default typescript operation. |
Ok, looks great. We'll be pleased to see a PR with an upgrade you proposed :) 👍 I think that Of course |
There is one but. I think some of this requires typescript 2+ (strict nulls or not). But well, it's the future and the present. |
Updating |
This typescript strict null checks option achieves exactly what it should, make you think about how you deal with null & undefined. Just if you're interested... I was actually surprised that I'll have the PR ready soon. Maybe no need to have |
See discussion in #53 abut why mapping to I agree that |
fixes #83 "typescript bindings & strict null checks"
Closing as it was applied |
When using the strict null checks mode in typescript, null & undefined are separated from the other types.
In other words, the signature of
fromNull
is definitely wrong:it should be:
and maybe we also want to allow undefined (mapping it to None):
That also mean that
orSome(null)
will not compile. We could do:or we do:
What do you think? Would you accept a PR regarding that (but then, implementing which variant?)
The text was updated successfully, but these errors were encountered: