dotty.tools.dotc.typer

Members list

Type members

Classlikes

object Applications

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait Applications extends Compatibility

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Typer
class ReTyper
class InlineTyper
class Typer
class Checker
Self type
object Checking

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Checking.type
trait Checking

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Checker
trait ReChecking
trait NoChecking
class Typer
class ReTyper
class InlineTyper
class Typer
Show all
object ConstFold

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
ConstFold.type
trait Deriving

A typer mixin that implements type class derivation functionality

A typer mixin that implements type class derivation functionality

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Typer
class ReTyper
class InlineTyper
class Typer
class Checker
Self type
object Docstrings

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Docstrings.type
object Dynamic

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Dynamic.type
trait Dynamic

Handles programmable member selections of Dynamic instances and values with structural types. Two functionalities:

Handles programmable member selections of Dynamic instances and values with structural types. Two functionalities:

  1. Translates selection that does not typecheck according to the scala.Dynamic rules: foo.bar(baz) = quux ~~> foo.selectDynamic(bar).update(baz, quux) foo.bar = baz ~~> foo.updateDynamic("bar")(baz) foo.bar(x = bazX, y = bazY, baz, ...) ~~> foo.applyDynamicNamed("bar")(("x", bazX), ("y", bazY), ("", baz), ...) foo.bar(baz0, baz1, ...) ~~> foo.applyDynamic(bar)(baz0, baz1, ...) foo.bar ~~> foo.selectDynamic(bar)

The first matching rule of is applied.

  1. Translates member selections on structural types to calls of selectDynamic or applyDynamic on a Selectable instance. @See handleStructural.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Typer
class ReTyper
class InlineTyper
class Typer
class Checker
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object EtaExpansion extends LiftImpure

Lifter for eta expansion

Lifter for eta expansion

Attributes

Supertypes
class LiftImpure
class Lifter
class Object
trait Matchable
class Any
Self type
object ForceDegree

An enumeration controlling the degree of forcing in "is-dully-defined" checks.

An enumeration controlling the degree of forcing in "is-dully-defined" checks.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
enum IfBottom

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Info relating to implicits that is kept for one run

Info relating to implicits that is kept for one run

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Run
class TASTYRun
Self type
Run
object Implicits

Implicit resolution

Implicit resolution

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Implicits.type
trait Implicits

The implicit resolution part of type checking

The implicit resolution part of type checking

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Typer
class ReTyper
class InlineTyper
class Typer
class Checker
Self type
object ImportInfo

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
ImportInfo.type
class ImportInfo(symf: Context ?=> Symbol, val selectors: List[ImportSelector], val qualifier: Tree, val isRootImport: Boolean) extends Showable

Info relating to an import clause

Info relating to an import clause

Value parameters

isRootImport

true if this is one of the implicit imports of scala, java.lang, scala.Predef in the start context, false otherwise.

qualifier

The import qualifier, or EmptyTree for root imports. Defined for all explicit imports from ident or select nodes.

selectors

The selector clauses

symf

A function that computes the import symbol defined by the clause

Attributes

Companion
object
Supertypes
trait Showable
class Object
trait Matchable
class Any

This trait defines the method importSuggestionAddendum that adds an addendum to error messages suggesting additional imports.

This trait defines the method importSuggestionAddendum that adds an addendum to error messages suggesting additional imports.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Typer
class ReTyper
class InlineTyper
class Typer
class Checker
Self type
object Inferencing

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait Inferencing

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Typer
class ReTyper
class InlineTyper
class Typer
class Checker
Self type
object JavaChecks

PostTyper doesn't run on java sources, but some checks still need to be applied.

PostTyper doesn't run on java sources, but some checks still need to be applied.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
JavaChecks.type
class LiftComplex extends Lifter

Lift all impure or complex arguments

Lift all impure or complex arguments

Attributes

Companion
object
Supertypes
class Lifter
class Object
trait Matchable
class Any
Known subtypes
object LiftComplex.type
object LiftErased.type
object LiftToDefs.type
object LiftComplex extends LiftComplex

Attributes

Companion
class
Supertypes
class LiftComplex
class Lifter
class Object
trait Matchable
class Any
Self type
object LiftCoverage extends LiftImpure

Lift impure + lift the prefixes

Lift impure + lift the prefixes

Attributes

Supertypes
class LiftImpure
class Lifter
class Object
trait Matchable
class Any
Self type
object LiftErased extends LiftComplex

Attributes

Supertypes
class LiftComplex
class Lifter
class Object
trait Matchable
class Any
Self type
LiftErased.type
class LiftImpure extends Lifter

Lift all impure arguments

Lift all impure arguments

Attributes

Companion
object
Supertypes
class Lifter
class Object
trait Matchable
class Any
Known subtypes
object EtaExpansion.type
object LiftCoverage.type
object LiftImpure.type
object LiftImpure extends LiftImpure

Attributes

Companion
class
Supertypes
class LiftImpure
class Lifter
class Object
trait Matchable
class Any
Self type
LiftImpure.type
object LiftToDefs extends LiftComplex

Lift all impure or complex arguments to defs

Lift all impure or complex arguments to defs

Attributes

Supertypes
class LiftComplex
class Lifter
class Object
trait Matchable
class Any
Self type
LiftToDefs.type
abstract class Lifter

A class that handles argument lifting. Argument lifting is needed in the following scenarios:

A class that handles argument lifting. Argument lifting is needed in the following scenarios:

  • eta expansion
  • applications with default arguments
  • applications with out-of-order named arguments Lifting generally lifts impure expressions only, except in the case of possible default arguments, where we lift also complex pure expressions, since in that case arguments can be duplicated as arguments to default argument methods.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class LiftComplex
object LiftComplex.type
object LiftErased.type
object LiftToDefs.type
class LiftImpure
object EtaExpansion.type
object LiftCoverage.type
object LiftImpure.type
object NoLift.type
Show all
class Namer

This class creates symbols from definitions and imports and gives them lazy types.

This class creates symbols from definitions and imports and gives them lazy types.

Timeline:

During enter, trees are expanded as necessary, populating the expandedTree map. Symbols are created, and the symOfTree map is set up.

Symbol completion causes some trees to be already typechecked and typedTree entries are created to associate the typed trees with the untyped expanded originals.

During typer, original trees are first expanded using expandedTree. For each expanded member definition or import we extract and remove the corresponding symbol from the symOfTree map and complete it. We then consult the typedTree map to see whether a typed tree exists already. If yes, the typed tree is returned as result. Otherwise, we proceed with regular type checking.

The scheme is designed to allow sharing of nodes, as long as each duplicate appears in a different method.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Typer
class ReTyper
class InlineTyper
class Typer
class Checker
Self type
trait NoChecking extends ReChecking

Attributes

Supertypes
trait ReChecking
trait Checking
class Object
trait Matchable
class Any
Known subtypes
class Typer
object NoLift extends Lifter

No lifting at all

No lifting at all

Attributes

Supertypes
class Lifter
class Object
trait Matchable
class Any
Self type
NoLift.type
object Nullables

Operations for implementing a flow analysis for nullability

Operations for implementing a flow analysis for nullability

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Nullables.type
case class OpenSearch(cand: Candidate, pt: Type, outer: SearchHistory)(using x$4: Context) extends SearchHistory

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ProtoTypes

Attributes

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

Type quotes '{ ... } and splices ${ ... }

Type quotes '{ ... } and splices ${ ... }

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Typer
class ReTyper
class InlineTyper
class Typer
class Checker
Self type
trait ReChecking extends Checking

Attributes

Supertypes
trait Checking
class Object
trait Matchable
class Any
Known subtypes
trait NoChecking
class Typer
class ReTyper
class InlineTyper
class Checker
class ReTyper(nestingLevel: Int) extends Typer, ReChecking

A version of Typer that keeps all symbols defined and referenced in a previously typed tree.

A version of Typer that keeps all symbols defined and referenced in a previously typed tree.

All definition nodes keep their symbols. All leaf nodes for idents, selects, and TypeTrees keep their types. Indexing is a no-op.

Otherwise, everything is as in Typer.

Attributes

Supertypes
trait ReChecking
class Typer
trait Deriving
trait Checking
trait Dynamic
trait Inferencing
trait Implicits
trait Applications
trait TypeAssigner
class Namer
class Object
trait Matchable
class Any
Show all
Known subtypes
class InlineTyper
class Typer
class Checker
object RefChecks

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
RefChecks.type
class RefChecks extends MiniPhase

Post-attribution checking and transformation, which fulfills the following roles

Post-attribution checking and transformation, which fulfills the following roles

  1. This phase performs the following checks.
  • only one overloaded alternative defines default arguments
  • applyDynamic methods are not overloaded
  • all overrides conform to rules laid down by checkAllOverrides.
  • any value classes conform to rules laid down by checkDerivedValueClass.
  • this(...) constructor calls do not forward reference other definitions in their block (not even lazy vals).
  • no forward reference in a local block jumps over a non-lazy val definition.
  • a class and its companion object do not both define a class or module with the same name.
  1. It warns about references to symbols labeled deprecated or migration.

  2. It eliminates macro definitions.

  3. It makes members not private where necessary. The following members cannot be private in the Java model:

  • term members of traits
  • the primary constructor of a value class
  • the parameter accessor of a value class
  • members accessed from an inner or companion class. All these members are marked as NotJavaPrivate. Unlike in Scala 2.x not-private members keep their name. It is up to the backend to find a unique expanded name for them. The rationale to do name changes that late is that they are very fragile.

todo: But RefChecks is not done yet. It's still a somewhat dirty port from the Scala 2 version. todo: move untrivial logic to their own mini-phases

Attributes

Companion
object
Supertypes
class MiniPhase
class Phase
class Object
trait Matchable
class Any
Self type
abstract class SearchHistory

Records the history of currently open implicit searches.

Records the history of currently open implicit searches.

A search history maintains a list of open implicit searches (openSearchPairs) a shortcut flag indicating whether any of these are by name (byname) and a reference to the root search history (root) which in turn maintains a possibly empty dictionary of recursive implicit terms constructed during this search.

A search history provides operations to create a nested search history, check for divergence, enter by name references and definitions in the implicit dictionary, lookup recursive references and emit a complete implicit dictionary when the outermost search is complete.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class OpenSearch
class SearchRoot
final class SearchRoot extends SearchHistory

The state corresponding to the outermost context of an implicit searcch.

The state corresponding to the outermost context of an implicit searcch.

Attributes

Supertypes
class Object
trait Matchable
class Any
class Synthesizer(typer: Typer)(using c: Context)

Synthesize terms for special classes

Synthesize terms for special classes

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object Synthesizer

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
sealed class TermRefSet(using x$1: Context)

A set of term references where equality is =:=

A set of term references where equality is =:=

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object TermRefSet

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
TermRefSet.type
trait TypeAssigner

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object TypeAssigner.type
class Typer
class ReTyper
class InlineTyper
class Typer
class Checker
Show all
object TypeAssigner extends TypeAssigner

Attributes

Companion
trait
Supertypes
trait TypeAssigner
class Object
trait Matchable
class Any
Self type
object Typer

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Typer.type

Typecheck trees, the main entry point is typed.

Typecheck trees, the main entry point is typed.

Value parameters

nestingLevel

The nesting level of the scope of this Typer.

Attributes

Companion
object
Supertypes
trait Deriving
trait Checking
trait Dynamic
trait Inferencing
trait Implicits
trait Applications
trait TypeAssigner
class Namer
class Object
trait Matchable
class Any
Show all
Known subtypes
class ReTyper
class InlineTyper
class Typer
class Checker
class TyperPhase(addRootImports: Boolean) extends Phase

Value parameters

addRootImports

Set to false in the REPL. Calling ImportInfo.withRootImports on the Context for each CompilationUnit causes dotty.tools.repl.ScriptedTests to fail.

Attributes

Companion
object
Supertypes
class Phase
class Object
trait Matchable
class Any
object TyperPhase

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
TyperPhase.type

Provides check method to check that all top-level definitions in tree are variance correct. Does not recurse inside methods. The method should be invoked once for each Template.

Provides check method to check that all top-level definitions in tree are variance correct. Does not recurse inside methods. The method should be invoked once for each Template.

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class VarianceChecker(using x$1: Context)

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Deprecated classlikes

object FrontEnd

Attributes

Deprecated
FrontEnd has been split into TyperPhase and Parser. Refer to one or the other.
Supertypes
class Object
trait Matchable
class Any
Self type
FrontEnd.type