Dotty Documentation

0.10.0-bin-SNAPSHOT

abstract class Scope
extends DotClass with Showable

A scope contains a set of symbols. It can be an extension of some outer scope, from which it inherits all symbols. This class does not have any methods to add symbols to a scope or to delete them. These methods are provided by subclass MutableScope.

[-] Constructors

Scope ( )

[-] Members

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

Returns a new mutable scope with the same content as this one.

[+] final def denotsNamed ( name: Name , select: SymDenotation => Boolean ) ( implicit ctx: Context ) : PreDenotation

The denotation set of all the symbols with given name in this scope Symbols occur in the result in reverse order relative to their occurrence in this.toList.

[+] def denotsNamed$default$2 : SymDenotation => Boolean

The denotation set of all the symbols with given name in this scope Symbols occur in the result in reverse order relative to their occurrence in this.toList.

[+] protected def ensureComplete ( ) ( implicit ctx: Context ) : Unit

Ensure that all elements of this scope have been entered. Overridden by SymbolLoaders.PackageLoader#PackageScope, where it makes sure that all names with $'s have been added.

[+] def exists ( p: Symbol => Boolean ) ( implicit ctx: Context ) : Boolean

Tests whether a predicate holds for at least one Symbol of this Scope.

[+] def filter ( p: Symbol => Boolean ) ( implicit ctx: Context ) : List [ Symbol ]

Selects all Symbols of this Scope which satisfy a predicate.

[+] final def filteredScope ( p: Symbol => Boolean ) ( implicit ctx: Context ) : Scope

The scope that keeps only those symbols from this scope that match the given predicates. If all symbols match, returns the scope itself, otherwise a copy with the matching symbols.

[+] def find ( p: Symbol => Boolean ) ( implicit ctx: Context ) : Symbol

Finds the first Symbol of this Scope satisfying a predicate, if any.

[+] def foreach ( f: Symbol => U ) ( implicit ctx: Context ) : Unit

Applies a function f to all Symbols of this Scope.

[+] def implicitDecls ( implicit ctx: Context ) : List [ TermRef ]
[+] def isEmpty : Boolean

Is the scope empty?

[+] def iterator ( implicit ctx: Context ) : Iterator [ Symbol ]

Return all symbols as an iterator in the order they were entered in this scope.

[+] def lastEntry : ScopeEntry

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

[+] final def lookup ( name: Name ) ( implicit ctx: Context ) : Symbol

Lookup a symbol

[+] final def lookupAll ( name: Name ) ( implicit ctx: Context ) : Iterator [ Symbol ]

Returns an iterator yielding every symbol with given name in this scope.

[+] def lookupEntry ( name: Name ) ( implicit ctx: Context ) : ScopeEntry

Lookup a symbol entry matching given name.

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

Lookup next entry with same name as this one

[+] def nestingLevel : Int

The number of outer scopes from which symbols are inherited

[+] def openForMutations : MutableScope
[+] def size : Int

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

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

The symbols in this scope in the order they were entered; inherited from outer ones first.

[+] final def toText ( printer: Printer ) : Text

The text representation of this showable element. This normally dispatches to a pattern matching method in Printers.