ReplCompiler

dotty.tools.repl.ReplCompiler
See theReplCompiler companion object
class ReplCompiler extends Compiler

This subclass of Compiler is adapted for use in the REPL.

  • compiles parsed expression in the current REPL state:
    • adds the appropriate imports in scope
    • wraps expressions into a dummy object
  • provides utility to query the type of an expression
  • provides utility to query the documentation of an expression

Attributes

Companion
object
Graph
Supertypes
class Compiler
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

final def compile(parsed: Parsed)(using state: State): Result[(CompilationUnit, State)]
def docOf(expr: String)(using state: State): Result[String]
def newRun(initCtx: Context, state: State): Run
final def typeCheck(expr: String, errorsAllowed: Boolean)(using state: State): Result[ValDef]
final def typeOf(expr: String)(using state: State): Result[String]

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

Inherited fields

var runId: Int

Attributes

Inherited from:
Compiler