A context is passed basically everywhere in dotc.
A context is passed basically everywhere in dotc. This is convenient but carries the risk of captured contexts in objects that turn into space leaks. To combat this risk, here are some conventions to follow:
initctx
. They pass initctx to all positions where it is needed
(and these positions should all be part of the intialization sequence of the class).cctx
(or they create one). Condensed contexts
just add some basic information to the context base without the
risk of capturing complete trees.A context base defines state and associated methods that exist once per compiler run.
The essential mutable state of a context base, collected into a common class
A fresh context allows selective modification of its attributes using the with...
A fresh context allows selective modification of its attributes using the with... methods.
Info that changes on each compiler run