Cleanup handling of Contexts in RunInfo and Implicits #3679
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.
In several situations, instead of the common pattern in the compiler of
using the enclosing Context available coming from an implicit method
parameter, we used some other Context. Changing this is necessary for #2922
to go through. #2922 is currently on hold and may never get in but the
Context handling simplifications seem worth having anyway:
It was previously used by
ImplicitRunInfo#implicitScope
, but can bereplaced by using the Context from the enclosing scope (which was already
used in this method with the name
liftingCtx
).either, we can just replace its lazy vals by defs that cache their results.
its implicit references come from, but this Context itself does not have
to be available implicitly in the class, instead the Context from the
enclosing scope is used.
This also requires replacing OfTypeImplicits#toString and
ContextualImplicits#toString by a toText method in Printer to get access
to a Context.