Dotty Documentation


case class State
extends Object with Product with Serializable

The state of the REPL contains necessary bindings instead of having to have mutation

The compiler in the REPL needs to do some wrapping in order to compile valid code. This wrapping occurs when a single MemberDef that cannot be top-level needs to be compiled. In order to do this, we need some unique identifier for each of these wrappers. That identifier is objectIndex.

Free expressions such as 1 + 1 needs to have an assignment in order to be of use. These expressions are therefore given a identifier on the format resX where X starts at 0 and each new expression that needs an identifier is given the increment of the old identifier. This identifier is valIndex.

[-] Constructors

State ( objectIndex: Int , valIndex: Int , imports: Map [ Int, List [ Import ] ] , context: Context )

[-] Members

[+] val context : Context
[+] val imports : Map [ Int, List [ Import ] ]
[+] val objectIndex : Int
[+] val valIndex : Int