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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make creation function argument optional for variants of type {} #31

Merged
merged 2 commits into from
Apr 22, 2018

Conversation

pelotom
Copy link
Owner

@pelotom pelotom commented Apr 22, 2018

Resolves #30 (reimplementation of #15 using conditional types).

Unlike in that proposal, this doesn't work for void, null, or any other type than {}. The reason for this is that {} is the only unit type which works for both "merged"/"multi-valued" and "separate"/"single-valued" kinds of unions. It doesn't seem feasible in a simple way to allow more than one unit type to trigger this behavior.

@coveralls
Copy link

coveralls commented Apr 22, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling b8f9c2c on optional-creation-args into 3d3e523 on master.

@pelotom pelotom merged commit ecae215 into master Apr 22, 2018
@pelotom pelotom deleted the optional-creation-args branch April 22, 2018 02:07
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 this pull request may close these issues.

2 participants