ExpressionCompiler

dotty.tools.debug.ExpressionCompiler

The expression compiler powers the debug console in Metals and the IJ Scala plugin, enabling evaluation of arbitrary Scala expressions at runtime (even macros). It produces class files that can be loaded by the running Scala program, to compute the evaluation output.

To do so, it extends the Compiler with 3 phases:

  • InsertExpression: parses and inserts the expression in the original source tree
  • ExtractExpression: extract the typed expression and places it in the new expression class
  • ResolveReflectEval: resolves local variables or inacessible members using reflection calls

Attributes

Graph
Supertypes
class Compiler
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override protected def frontendPhases: List[List[Phase]]

Phases dealing with the frontend up to trees ready for TASTY pickling

Phases dealing with the frontend up to trees ready for TASTY pickling

Attributes

Definition Classes
override protected def transformPhases: List[List[Phase]]

Phases dealing with the transformation from pickled trees to backend trees

Phases dealing with the transformation from pickled trees to backend trees

Attributes

Definition Classes

Inherited methods

def newRun(using Context): Run

Attributes

Inherited from:
Compiler
def nextRunId: Int

Attributes

Inherited from:
Compiler

Meta-ordering constraint:

Meta-ordering constraint:

DenotTransformers that change the signature of their denotation's info must go after erasure. The reason is that denotations are permanently referred to by TermRefs which contain a signature. If the signature of a symbol would change, all refs to it would become outdated - they could not be dereferenced in the new phase.

After erasure, signature changing denot-transformers are OK because signatures are never recomputed later than erasure.

Attributes

Inherited from:
Compiler
def reset()(using Context): Unit

Attributes

Inherited from:
Compiler