dotty.tools.dotc

typer

package typer

Visibility
  1. Public
  2. All

Type Members

  1. trait Applications extends Compatibility

  2. trait Checking extends AnyRef

  3. trait Docstrings extends AnyRef

  4. trait Dynamic extends AnyRef

    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)

    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.

  5. class FrontEnd extends DotClass with Phase

  6. trait ImplicitRunInfo extends AnyRef

    Info relating to implicits that is kept for one run

  7. trait Implicits extends AnyRef

    The implicit resolution part of type checking

  8. class ImportInfo extends AnyRef

    Info relating to an import clause

  9. class Inliner extends AnyRef

    Produces an inlined version of call via its inlined method.

  10. class Namer extends AnyRef

    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.

  11. trait NamerContextOps extends AnyRef

  12. trait NoChecking extends Checking

  13. class ReTyper extends Typer

    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.

  14. class RefChecks extends DotClass with 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.

    2. It warns about references to symbols labeled deprecated or migration.

    3. It performs the following transformations:

    • if (true) A else B --> A if (false) A else B --> B
    • macro definitions are eliminated.

    4. 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

  15. class SearchHistory extends AnyRef

    Records the history of currently open implicit searches

  16. class TermRefSet extends Traversable[TermRef]

    A set of term references where equality is =:=

  17. trait TypeAssigner extends AnyRef

  18. class Typer extends Namer with TypeAssigner with Applications with Implicits with Dynamic with Checking with Docstrings

  19. class VarianceChecker extends AnyRef

Value Members

  1. object Applications

  2. object Checking

  3. object ConstFold

  4. object Dynamic

  5. object EmptyTermRefSet extends TermRefSet

    Annotations
    @sharable()
  6. object ErrorReporting

  7. object EtaExpansion

  8. 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.

    Annotations
    @sharable()
  9. object Implicits

    Implicit resolution

  10. object ImportInfo

  11. object Inferencing

  12. object Inliner

  13. object ProtoTypes

  14. object RefChecks

  15. object TypeAssigner extends TypeAssigner

  16. object Typer

  17. object VarianceChecker

    Provides check method to check that all top-level definitions in tree are variance correct.

    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.

  18. object Variances

Ungrouped