[REVERTED] Prune polymorphic implicits more aggressively#7067
Merged
adriaanm merged 1 commit intoSep 7, 2018
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
In rankImplicits, before we attempt to fully typecheck the pending candidate implicit, we first attempt to partially instantiate type variables in both the candidate and the target type and check for compatibility. If the compatibility check fails we can immediately prune the the candidate without having to fully typecheck it. In the kinds of implicit searches typical of the inductive style found in shapeless and related libraries this can result in a drastic reduction in the search space and a corresponding reduction in compile times. As an added bonus users of shapeless and shapeless based libraries which use shapeless's Lazy type will see benefits immediately without needing to wait for and port to byname implicit arguments.
306c280 to
73da4fc
Compare
Contributor
Author
|
Rebased ... |
Contributor
Author
|
Awesome 🙂 |
Contributor
|
@milessabin this regressed a usage of specs2, discovered while running the community build on 2.12.7: I confirmed that reverting this PR (and the undoLog changes from 6ea993a) makes it compile again. I'm not sure it's the same instance of the problem that you saw in the 2.13.x version. Thoughts? |
Contributor
|
Given how far past the 2.12.7 deadline we are, I decided to revert as much as needed to get the community build to go green. We'll have to save these improvements for 2.13 |
Merged
adriaanm
added a commit
to adriaanm/scalajs-react
that referenced
this pull request
Sep 28, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a backport of #6580 targetting 2.12.7.
In
rankImplicits, before we attempt to fully typecheck the pending candidate implicit, we first attempt to partially instantiate type variables in both the candidate and the target type and check for compatibility. If the compatibility check fails we can immediately prune the the candidate without having to fully typecheck it.In the kinds of implicit searches typical of the inductive style found in shapeless and related libraries this can result in a drastic reduction in the search space and a corresponding reduction in compile
times.
As an added bonus users of shapeless and shapeless based libraries which use shapeless's
Lazytype will see benefits immediately without needing to wait for and port to byname implicit arguments.