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

Relax type equality constraint to subtype #53

Merged

Conversation

travisbrown
Copy link
Contributor

Requiring type equality for syntax methods when there's a constraint on the instance type causes problems if the target type needs to be inferred (see this issue in Cats for some discussion).

Relaxing the constraint to only require evidence of a subtype relationship helps type inference and (as far as I can tell) doesn't cause other problems.

I've also tested this change against 0.6.1 and it looks like it could be backported for a 0.6.2 release (which would help us out with Cats 0.4.0).

/cc @ceedubs @mpilquist

@ceedubs
Copy link

ceedubs commented Jan 30, 2016

👍 looks good to me.

It would probably be nice to have a unit test for the case that we ran into with Cats. But I'm not volunteering to write it right at the moment so this is probably not a very helpful recommendation :P

@travisbrown
Copy link
Contributor Author

@ceedubs That's reasonable. I just added a test and confirmed that it fails (or rather doesn't compile) without the change in the first commit.

@ceedubs
Copy link

ceedubs commented Jan 30, 2016

@travisbrown fantastic. Thanks!

mpilquist added a commit that referenced this pull request Jan 30, 2016
@mpilquist mpilquist merged commit c2416db into typelevel:master Jan 30, 2016
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.

3 participants