dotty.tools.dotc.core

TypeOps

Related Docs: object TypeOps | package core

trait TypeOps extends AnyRef

Self Type
Context
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. TypeOps
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. class AsSeenFromMap extends TypeMap

    The TypeMap handling the asSeenFrom in more complicated cases

  2. type BoundsViolation = (ast.tpd.Tree, String, Type)

    An argument bounds violation is a triple consisting of

    An argument bounds violation is a triple consisting of

    • the argument tree
    • a string "upper" or "lower" indicating which bound is violated
    • the violated bound
  3. class SimplifyMap extends TypeMap

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. final def asSeenFrom(tp: Type, pre: Type, cls: Symbol): Type

    The type tp as seen from prefix pre and owner cls.

    The type tp as seen from prefix pre and owner cls. See the spec for what this means. Called very often, so the code is optimized heavily.

    A tricky aspect is what to do with unstable prefixes. E.g. say we have a class

    class C { type T; def f(x: T): T }

    and an expression e of type C. Then computing the type of e.f leads to the query asSeenFrom(C, (x: T)T). What should its result be? The naive answer (x: C#T)C#T is incorrect given that we treat C#T as the existential exists(c: C)c.T. What we need to do instead is to skolemize the existential. So the answer would be (x: c.T)c.T for some (unknown) value c of type C. c.T is expressed in the compiler as a skolem type Skolem(C).

    Now, skolemization is messy and expensive, so we want to do it only if we absolutely must. Also, skolemizing immediately would mean that asSeenFrom was no longer idempotent - each call would return a type with a different skolem. Instead we produce an annotated type that marks the prefix as unsafe:

    (x: (C @ UnsafeNonvariant)#T)C#T

    We also set a global state flag unsafeNonvariant to the current run. When typing a Select node, typer will check that flag, and if it points to the current run will scan the result type of the select for

  6. def boundsViolations(args: List[ast.tpd.Tree], boundss: List[TypeBounds], instantiate: (Type, List[Type]) ⇒ Type)(implicit ctx: Context): List[Contexts.Context.BoundsViolation]

    The list of violations where arguments are not within bounds.

    The list of violations where arguments are not within bounds.

    args

    The arguments

    boundss

    The list of type bounds

    instantiate

    A function that maps a bound type and the list of argument types to a resulting type. Needed to handle bounds that refer to other bounds.

  7. def canAutoTuple: Boolean

    Is auto-tupling enabled?

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. object deskolemize extends ApproximatingTypeMap

    Approximate a type tp with a type that does not contain skolem types.

  10. def dynamicsEnabled: Boolean

  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def featureEnabled(owner: ClassSymbol, feature: TermName): Boolean

    Is feature enabled in class owner? This is the case if one of the following two alternatives holds:

    Is feature enabled in class owner? This is the case if one of the following two alternatives holds:

    1. The feature is imported by a named import

    import owner.feature

    (the feature may be bunched with others, or renamed, but wildcard imports don't count).

    2. The feature is enabled by a compiler option

    • language:<prefix>feature

    where <prefix> is the full name of the owner followed by a "." minus the prefix "dotty.language.".

  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def forwardRef(argSym: Symbol, from: Symbol, to: TypeBounds, cls: ClassSymbol, decls: Scope): Unit

    If we have member definitions

    If we have member definitions

    type argSym v= from type from v= to

    where the variances of both alias are the same, then enter a new definition

    type argSym v= to

    unless a definition for argSym already exists in the current scope.

  16. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  17. def harmonizeUnion(tp: Type): Type

    Given a disjunction T1 | ...

    Given a disjunction T1 | ... | Tn of types with potentially embedded type variables, constrain type variables further if this eliminates some of the branches of the disjunction. Do this also for disjunctions embedded in intersections, as parents in refinements, and in recursive types.

    For instance, if A is an unconstrained type variable, then

    ArrayBuffer[Int] | ArrayBuffer[A]

    is approximated by constraining A to be =:= to Int and returning ArrayBuffer[Int] instead of ArrayBuffer[_ >: Int | A <: Int & A]

  18. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  20. def makePackageObjPrefixExplicit(tpe: NamedType): Type

    If tpe is of the form p.x where p refers to a package but x is not owned by a package, expand it to

    If tpe is of the form p.x where p refers to a package but x is not owned by a package, expand it to

    p.package.x

  21. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  22. def normalizeToClassRefs(parents: List[Type], cls: ClassSymbol, decls: Scope): List[TypeRef]

    Normalize a list of parent types of class cls that may contain refinements to a list of typerefs referring to classes, by converting all refinements to member definitions in scope decls.

    Normalize a list of parent types of class cls that may contain refinements to a list of typerefs referring to classes, by converting all refinements to member definitions in scope decls. Can add members to decls as a side-effect.

  23. final def notify(): Unit

    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  25. def orDominator(tp: Type): Type

    Approximate union type by intersection of its dominators.

    Approximate union type by intersection of its dominators. That is, replace a union type Tn | ... | Tn by the smallest intersection type of base-class instances of T1,...,Tn. Example: Given

    trait C[+T] trait D class A extends C[A] with D class B extends C[B] with D with E

    we approximate A | B by C[A | B] with D

  26. def scala2Mode: Boolean

  27. final def simplify(tp: Type, theMap: Contexts.Context.SimplifyMap): Type

    Implementation of Types#simplified

  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  29. def testScala2Mode(msg: String, pos: Position): Boolean

  30. def toString(): String

    Definition Classes
    AnyRef → Any
  31. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped