class MutableScope
extends Scope

A subclass of Scope that defines methods for entering and unlinking entries. Note: constructor is protected to force everyone to use the factory methods newScope or newNestedScope instead. This is necessary because when run from reflection every scope needs to have a SynchronizedScope as mixin.

Constructors

MutableScope ( initElems: ScopeEntry , initSize: Int , nestingLevel: Int )
MutableScope ( base: Scope )
MutableScope ( implicit ctx: Context )
MutableScope ( )

Members

private var _size : Int

The size of the scope

The size of the scope

private var elemsCache : List [ Symbol ]

a cache for all elements, to be used by symbol iterator.

a cache for all elements, to be used by symbol iterator.

private var hashTable : Array [ ScopeEntry ]

the hash table

the hash table

private val initElems : ScopeEntry
private val initSize : Int
var lastEntry : ScopeEntry

The last scope-entry from which all others are reachable via prev

The last scope-entry from which all others are reachable via prev

val nestingLevel : Int

The number of outer scopes from which symbols are inherited

The number of outer scopes from which symbols are inherited

override def checkConsistent ( ) ( implicit ctx: Context ) : Unit

Check that all symbols in this scope are in their correct hashtable buckets.

Check that all symbols in this scope are in their correct hashtable buckets.

def cloneScope ( implicit ctx: Context ) : MutableScope

Clone scope, taking care not to force the denotations of any symbols in the scope.

Clone scope, taking care not to force the denotations of any symbols in the scope.

private def createHash ( tableSize: Int ) ( implicit ctx: Context ) : Unit
private def elemsCache_= ( x$1: List [ Symbol ] ) : Unit

a cache for all elements, to be used by symbol iterator.

a cache for all elements, to be used by symbol iterator.

private def ensureCapacity ( tableSize: Int ) ( implicit ctx: Context ) : Unit
final def enter ( sym: T ) ( implicit ctx: Context ) : T

enter a symbol in this scope.

enter a symbol in this scope.

private def enterAllInHash ( e: ScopeEntry , n: Int ) ( implicit ctx: Context ) : Unit
def enterAllInHash$default$2 : Int
private def enterInHash ( e: ScopeEntry ) ( implicit ctx: Context ) : Unit
final def enterUnique ( sym: Symbol ) ( implicit ctx: Context ) : Unit

enter a symbol, asserting that no symbol with same name exists in scope

enter a symbol, asserting that no symbol with same name exists in scope

private def hashTable_= ( x$1: Array [ ScopeEntry ] ) : Unit

the hash table

the hash table

override def implicitDecls ( implicit ctx: Context ) : List [ TermRef ]
def lastEntry_= ( x$1: ScopeEntry ) : Unit
override def lookupEntry ( name: Name ) ( implicit ctx: Context ) : ScopeEntry

Lookup a symbol entry matching given name.

Lookup a symbol entry matching given name.

override final def lookupNextEntry ( entry: ScopeEntry ) ( implicit ctx: Context ) : ScopeEntry

lookup next entry with same name as this one

lookup next entry with same name as this one

protected def newScopeEntry ( name: Name , sym: Symbol ) ( implicit ctx: Context ) : ScopeEntry

create and enter a scope entry with given name and symbol

create and enter a scope entry with given name and symbol

protected def newScopeEntry ( sym: Symbol ) ( implicit ctx: Context ) : ScopeEntry

create and enter a scope entry

create and enter a scope entry

protected def newScopeLikeThis ( ) : MutableScope
override def openForMutations : MutableScope
final def replace ( prev: Symbol , replacement: Symbol ) ( implicit ctx: Context ) : Unit

Replace symbol prev (if it exists in current scope) by symbol replacement.

Replace symbol prev (if it exists in current scope) by symbol replacement.

override final def size : Int

The number of symbols in this scope (including inherited ones from outer scopes).

The number of symbols in this scope (including inherited ones from outer scopes).

private def size_= ( x: Int ) : Unit
final def sorted ( implicit ctx: Context ) : List [ Symbol ]

Vanilla scope - symbols are stored in declaration order.

Vanilla scope - symbols are stored in declaration order.

override final def toList ( implicit ctx: Context ) : List [ Symbol ]

Returns all symbols as a list in the order they were entered in this scope. Does not include the elements of inherited scopes.

Returns all symbols as a list in the order they were entered in this scope. Does not include the elements of inherited scopes.

final def unlink ( e: ScopeEntry ) ( implicit ctx: Context ) : Unit

Remove entry from this scope (which is required to be present)

Remove entry from this scope (which is required to be present)

final def unlink ( sym: Symbol ) ( implicit ctx: Context ) : Unit

remove symbol from this scope if it is present

remove symbol from this scope if it is present