Dotty Documentation

0.14.0-bin-SNAPSHOT

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

[+] private var elemsCache : List [ Symbol ]

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

[+] private var hashTable : Array [ ScopeEntry ]

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

[+] val nestingLevel : Int

The number of outer scopes from which symbols are inherited

[+] private var synthesize : SymbolSynthesizer

The synthesizer to be used, or null if no synthesis is done on this scope

[+] override def checkConsistent ( ) ( implicit ctx: Context ) : Unit

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.

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

enter a symbol in this scope.

[+] private def enterAllInHash ( e: ScopeEntry , n: Int ) ( implicit ctx: Context ) : Unit
[+] private 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

[+] 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.

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

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

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

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.

[+] override final def size : Int

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.

[+] private def synthesize_= ( x$1: SymbolSynthesizer ) : Unit

The synthesizer to be used, or null if no synthesis is done on this scope

[+] 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.

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

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

[+] final def unlink ( sym: Symbol , name: Name ) ( implicit ctx: Context ) : Unit

remove symbol from this scope if it is present under the given name

[+] def useSynthesizer ( s: SymbolSynthesizer ) : Unit

Use specified synthesize for this scope