dotty.tools.dotc.util

Members list

Type members

Classlikes

object Attachment

A class inheriting from Attachment.Container supports adding, removing and lookup of attachments. Attachments are typed key/value pairs.

A class inheriting from Attachment.Container supports adding, removing and lookup of attachments. Attachments are typed key/value pairs.

Attachments whose key is an instance of StickyKey will be kept when the attachments are copied using withAttachmentsFrom.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Attachment.type
class CharBuffer(initialSize: Int)

A character buffer that exposes the internal array for reading. That way we can avoid copying when converting to names.

A character buffer that exposes the internal array for reading. That way we can avoid copying when converting to names.

Attributes

Supertypes
class Object
trait Matchable
class Any
object Chars

Contains constants and classifier methods for characters

Contains constants and classifier methods for characters

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Chars.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

The comment parsing in dotc is used by both the comment cooking and the scaladoc tool.

The comment parsing in dotc is used by both the comment cooking and the scaladoc tool.

The comment cooking is used to expand comments with <invalid inheritdoc annotation> and @define annotations. The rest of the comment is untouched and later handled by scaladoc.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object DiffUtil

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
DiffUtil.type
class DotClass

Adds standard functionality to a class. For now: Just the unsupported method.

Adds standard functionality to a class. For now: Just the unsupported method.

Attributes

Supertypes
class Object
trait Matchable
class Any
class EqHashMap[Key, Value](initialCapacity: Int, capacityMultiple: Int) extends GenericHashMap[Key, Value]

A specialized implementation of GenericHashMap with identity hash and eq as comparison.

A specialized implementation of GenericHashMap with identity hash and eq as comparison.

Attributes

Supertypes
class GenericHashMap[Key, Value]
class MutableMap[Key, Value]
class ReadOnlyMap[Key, Value]
class Object
trait Matchable
class Any
Show all
abstract class FreshNameCreator

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Default

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class GenericHashMap[Key, Value](initialCapacity: Int, capacityMultiple: Int) extends MutableMap[Key, Value]

A hash table using open hashing with linear scan which is also very space efficient at small sizes. The implementations of hash and isEqual are left open. They have to be provided by subclasses.

A hash table using open hashing with linear scan which is also very space efficient at small sizes. The implementations of hash and isEqual are left open. They have to be provided by subclasses.

Value parameters

capacityMultiple

The minimum multiple of capacity relative to used elements. The hash table will be re-sized once the number of elements multiplied by capacityMultiple exceeds the current size of the hash table. However, a table of size up to DenseLimit will be re-sized only once the number of elements reaches the table's size.

initialCapacity

Indicates the initial number of slots in the hash table. The actual number of slots is always a power of 2, so the initial size of the table will be the smallest power of two that is equal or greater than the given initialCapacity. Minimum value is 4.

Attributes

Companion
object
Supertypes
class MutableMap[Key, Value]
class ReadOnlyMap[Key, Value]
class Object
trait Matchable
class Any
Known subtypes
class EqHashMap[Key, Value]
class HashMap[Key, Value]
class HashMap[Key, Value](initialCapacity: Int, capacityMultiple: Int) extends GenericHashMap[Key, Value]

A specialized implementation of GenericHashMap with standard hashCode and equals as comparison

A specialized implementation of GenericHashMap with standard hashCode and equals as comparison

Attributes

Supertypes
class GenericHashMap[Key, Value]
class MutableMap[Key, Value]
class ReadOnlyMap[Key, Value]
class Object
trait Matchable
class Any
Show all
object HashSet

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
HashSet.type
class HashSet[T](initialCapacity: Int, capacityMultiple: Int) extends MutableSet[T]

A hash set that allows some privileged protected access to its internals

A hash set that allows some privileged protected access to its internals

Value parameters

capacityMultiple

The minimum multiple of capacity relative to used elements. The hash table will be re-sized once the number of elements multiplied by capacityMultiple exceeds the current size of the hash table. However, a table of size up to DenseLimit will be re-sized only once the number of elements reaches the table's size.

initialCapacity

Indicates the initial number of slots in the hash table. The actual number of slots is always a power of 2, so the initial size of the table will be the smallest power of two that is equal or greater than the given initialCapacity. Minimum value is 4.

Attributes

Companion
object
Supertypes
class MutableSet[T]
class ReadOnlySet[T]
class Object
trait Matchable
class Any
final class IntMap[Key](initialCapacity: Int, capacityMultiple: Int) extends PerfectHashing[Key]

A dense map from some Key type to Int. Dense means: All keys and values are stored in arrays from 0 up to the size of the map. Keys and values can be obtained by index usingkey(index)andvalue(index). Values can also be stored usingsetValue(index, value)`.

A dense map from some Key type to Int. Dense means: All keys and values are stored in arrays from 0 up to the size of the map. Keys and values can be obtained by index usingkey(index)andvalue(index). Values can also be stored usingsetValue(index, value)`.

ome privileged protected access to its internals

Value parameters

capacityMultiple

The minimum multiple of capacity relative to used elements. The hash table will be re-sized once the number of elements multiplied by capacityMultiple exceeds the current size of the hash table. However, a table of size up to DenseLimit will be re-sized only once the number of elements reaches the table's size.

initialCapacity

Indicates the initial number of slots in the hash table. The actual number of slots is always a power of 2, so the initial size of the table will be the smallest power of two that is equal or greater than the given initialCapacity. Minimum value is 4.

Attributes

Supertypes
class PerfectHashing[Key]
class Object
trait Matchable
class Any
class LRUCache[Key >: Null <: AnyRef, Value >: Null]

A least-recently-used cache for Key -> Value computations It currently keeps the last 8 associations, but this can be changed to anywhere between 2 and 16 by changing LRUCache.Retained.

A least-recently-used cache for Key -> Value computations It currently keeps the last 8 associations, but this can be changed to anywhere between 2 and 16 by changing LRUCache.Retained.

Implementation: We keep a ring of eight places, linked with the next data structure. The ring models a priority queue. last points to the last element of the queue, and next(last) to the first one. Lookups compare keys sequentially from first to last. Elements with successful lookup get promoted to be first in the queue. Elements are evicted at the last position.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object LRUCache

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
LRUCache.type
object LinearMap

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
LinearMap.type
object LinearSet

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
LinearSet.type
abstract class MutableMap[Key, Value] extends ReadOnlyMap[Key, Value]

A common class for lightweight mutable maps.

A common class for lightweight mutable maps.

Attributes

Supertypes
class ReadOnlyMap[Key, Value]
class Object
trait Matchable
class Any
Known subtypes
class GenericHashMap[Key, Value]
class EqHashMap[Key, Value]
class HashMap[Key, Value]
abstract class MutableSet[T] extends ReadOnlySet[T]

A common class for lightweight mutable sets.

A common class for lightweight mutable sets.

Attributes

Supertypes
class ReadOnlySet[T]
class Object
trait Matchable
class Any
Known subtypes
class HashSet[T]
class WeakHashSet[A]
class Uniques

Provides functions to encode and decode Scala symbolic names.

Provides functions to encode and decode Scala symbolic names.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object NoSource extends SourceFile

Attributes

Supertypes
class SourceFile
trait SourceFile
trait AbstractFile
class Object
trait Matchable
class Any
Show all
Self type
NoSource.type

A sentinel for a non-existing source position

A sentinel for a non-existing source position

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Showable
trait SourcePosition
trait SrcPos
class Object
trait Matchable
class Any
Show all
Self type
class ParsedComment(val comment: Comment)

A parsed doc comment.

A parsed doc comment.

Value parameters

comment

The doc comment to parse

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object ParsedComment

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class PerfectHashing[Key](initialCapacity: Int, capacityMultiple: Int)

A map that maps keys to unique integers in a dense interval starting at 0.

A map that maps keys to unique integers in a dense interval starting at 0.

Value parameters

capacityMultiple

The minimum multiple of capacity relative to used elements. The hash table will be re-sized once the number of elements multiplied by capacityMultiple exceeds the current size of the hash table. However, a table of size up to DenseLimit will be re-sized only once the number of elements reaches the table's size.

initialCapacity

Indicates the initial number of slots in the hash table. The actual number of slots is always a power of 2, so the initial size of the table will be the smallest power of two that is equal or greater than the given initialCapacity. Minimum value is 4.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class IntMap[Key]
object Property

Defines a key type with which to tag properties, such as attachments or context properties

Defines a key type with which to tag properties, such as attachments or context properties

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Property.type
abstract class ReadOnlyMap[Key, Value]

A class for the reading part of mutable or immutable maps.

A class for the reading part of mutable or immutable maps.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class MutableMap[Key, Value]
class GenericHashMap[Key, Value]
class EqHashMap[Key, Value]
class HashMap[Key, Value]
abstract class ReadOnlySet[T]

A class for the readonly part of mutable sets.

A class for the readonly part of mutable sets.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class MutableSet[T]
class HashSet[T]
class WeakHashSet[A]
class Uniques
Show all
object ReadOnlySet

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
final class ReusableInstance[T <: AnyRef]

A wrapper for a list of cached instances of a type T. The wrapper is recursion-reentrant: several instances are kept, so at each depth of reentrance we are reusing the instance for that.

A wrapper for a list of cached instances of a type T. The wrapper is recursion-reentrant: several instances are kept, so at each depth of reentrance we are reusing the instance for that.

An instance is created upon creating this object, and more instances are allocated dynamically, on demand, when reentrance occurs.

Not thread safe.

Ported from scala.reflect.internal.util.ReusableInstance

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object ShowPickled

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object Signatures

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Signatures.type
abstract class SimpleIdentityMap[K <: AnyRef, +V <: AnyRef] extends K => V | Null

A simple linked map with eq as the key comparison, optimized for small maps. It has linear complexity for apply, updated, and remove.

A simple linked map with eq as the key comparison, optimized for small maps. It has linear complexity for apply, updated, and remove.

Attributes

Companion
object
Supertypes
trait K => V | Null
class Object
trait Matchable
class Any
Known subtypes
class Map1[K, V]
class Map2[K, V]
class Map3[K, V]
class Map4[K, V]
class MapMore[K, V]

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class SimpleIdentitySet[+Elem <: AnyRef]

A simple linked set with eq as the comparison, optimized for small sets. It has linear complexity for contains, +, and -.

A simple linked set with eq as the comparison, optimized for small sets. It has linear complexity for contains, +, and -.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object empty.type

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
final class SixteenNibbles(val bits: Long) extends AnyVal

An efficient implementation of sequences of 16 indexed elements with values 0..15 in a single Long.

An efficient implementation of sequences of 16 indexed elements with values 0..15 in a single Long.

Attributes

Companion
object
Supertypes
class AnyVal
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class SourceFile(val file: AbstractFile, computeContent: => Array[Char]) extends SourceFile

Attributes

Companion
object
Supertypes
trait SourceFile
trait AbstractFile
class Object
trait Matchable
class Any
Known subtypes
object NoSource.type
object SourceFile

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
SourceFile.type
case class SourcePosition(source: SourceFile, span: Span, outer: SourcePosition) extends SrcPos, SourcePosition, Showable

A source position is comprised of a span and a source file

A source position is comprised of a span and a source file

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Showable
trait SourcePosition
trait SrcPos
class Object
trait Matchable
class Any
Show all
Known subtypes
object NoSourcePosition.type
object Spans

The offsets part of a full position, consisting of 2 or 3 entries:

The offsets part of a full position, consisting of 2 or 3 entries:

  • start: the start offset of the span, in characters from start of file
  • end : the end offset of the span
  • point: if given, the offset where a single ^ would be logically placed

Spans are encoded according to the following format in little endian: Start: unsigned 26 Bits (works for source files up to 64M) End: unsigned 26 Bits Point: unsigned 12 Bits relative to start NoSpan encoded as -1L (this is a normally invalid span because point would lie beyond end).

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Spans.type
trait SrcPos

Things that can produce a source position and a span

Things that can produce a source position and a span

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Positioned
class Tree[T]
class Block[T]
class XMLBlock
class CaseDef[T]
class DenotingTree[T]
trait DefTree[T]
class NamedDefTree[T]
class Bind[T]
class MemberDef[T]
class TypeDef[T]
class ValOrDefDef[T]
class DefDef[T]
class ValDef[T]
class EmptyValDef[T]
trait ValOrTypeDef[T]
class ModuleDef
class Template[T]
class ImportOrExport[T]
class Export[T]
class Import[T]
class NameTree[T]
class Labeled[T]
class RefTree[T]
class Ident[T]
object EmptyTypeIdent.type
class Select[T]
class SelectWithSig[T]
class This[T]
class TypeTree[T]
class InferredTypeTree[T]
class TermRefTree
class TypeRefTree
class Hole[T]
class Inlined[T]
class Literal[T]
class NamedArg[T]
class New[T]
trait PatternTree[T]
class Alternative[T]
class UnApply[T]
class ProxyTree[T]
class Annotated[T]
class AppliedTypeTree[T]
class GenericApply[T]
class Apply[T]
class TypeApply[T]
class PackageDef[T]
class RefinedTypeTree[T]
class Super[T]
class Typed[T]
class Parens
class TypedSplice
class SeqLiteral[T]
class JavaSeqLiteral[T]
trait TermTree[T]
class Assign[T]
class Closure[T]
class If[T]
class InlineIf[T]
class Match[T]
class InlineMatch[T]
class Quote[T]
class Return[T]
class Splice[T]
class SplicePattern[T]
class Try[T]
class WhileDo[T]
class Thicket[T]
class EmptyTree[T]
trait TypTree[T]
class ByNameTypeTree[T]
class LambdaTypeTree[T]
class MatchTypeTree[T]
class TypeBoundsTree[T]
trait WithoutTypeOrPos[T]
class ExtMethods
class Function
class GenAlias
class GenFrom
class Into
class MacroTree
class OpTree
class InfixOp
class PostfixOp
class PrefixOp
class PolyFunction
class Tuple
class Mod
class Abstract
class Erased
class Final
class Given
class Implicit
class Impure
class Infix
class Inline
class Lazy
class Opaque
class Open
class Override
class Private
class Protected
class Sealed
class Transparent
class Var
class Symbol
class ClassSymbol
object NoSymbol.type
object NoSourcePosition.type
Show all
object StackTraceOps

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object Stats

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Stats.type
object Store

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Store.type
final class Store(elems: Array[AnyRef | Null]) extends AnyVal

Attributes

Companion
object
Supertypes
class AnyVal
trait Matchable
class Any
object Util

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Util.type
abstract class WeakHashSet[A <: AnyRef](initialCapacity: Int, loadFactor: Double) extends MutableSet[A]

A HashSet where the elements are stored weakly. Elements in this set are eligible for GC if no other hard references are associated with them. Its primary use case is as a canonical reference identity holder (aka "hash-consing") via findEntryOrUpdate

A HashSet where the elements are stored weakly. Elements in this set are eligible for GC if no other hard references are associated with them. Its primary use case is as a canonical reference identity holder (aka "hash-consing") via findEntryOrUpdate

This Set implementation cannot hold null. Any attempt to put a null in it will result in a NullPointerException

This set implementation is not in general thread safe without external concurrency control. However it behaves properly when GC concurrently collects elements in this set.

Attributes

Companion
object
Supertypes
class MutableSet[A]
class ReadOnlySet[A]
class Object
trait Matchable
class Any
Known subtypes
object WeakHashSet

Companion object for WeakHashSet

Companion object for WeakHashSet

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
object common

Common values hoisted out for performance

Common values hoisted out for performance

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
common.type
object concurrent

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
concurrent.type
object optional

A prompt for Option, which establishes a boundary which _.? on Option can return

A prompt for Option, which establishes a boundary which _.? on Option can return

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
optional.type

Types

opaque type LinearMap[K <: AnyRef, V <: AnyRef | Null]

A linear map is a map where after an updated the previous map value cannot be used anymore. The map is implemented as an immutable map for sizes <= 4 (where immutable maps have specialized, compact representations) and as a HashMap for larger sizes.

A linear map is a map where after an updated the previous map value cannot be used anymore. The map is implemented as an immutable map for sizes <= 4 (where immutable maps have specialized, compact representations) and as a HashMap for larger sizes.

Attributes

opaque type LinearSet[Elem <: AnyRef | Null]

A linear set is a set where after a + the previous set value cannot be used anymore. The set is implemented as an immutable set for sizes <= 4 and as a HashSet for larger sizes.

A linear set is a set where after a + the previous set value cannot be used anymore. The set is implemented as an immutable set for sizes <= 4 and as a HashSet for larger sizes.

Attributes

type optional[T] = Label[None.type] ?=> T

Return type that indicates that the method returns a T or aborts to the enclosing boundary with a None

Return type that indicates that the method returns a T or aborts to the enclosing boundary with a None

Attributes