dotty.tools.dotc.core

ExplainingTypeComparer

Related Doc: package core

class ExplainingTypeComparer extends TypeComparer

A type comparer that can record traces of subtype operations

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ExplainingTypeComparer
  2. TypeComparer
  3. ConstraintHandling
  4. DotClass
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ExplainingTypeComparer(initctx: Context)

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. def AnyClass: ClassSymbol

    Definition Classes
    TypeComparer
  5. def AnyType: TypeRef

    Definition Classes
    TypeComparer
  6. def NothingClass: ClassSymbol

    Definition Classes
    TypeComparer
  7. def NothingType: TypeRef

    Definition Classes
    TypeComparer
  8. def NullClass: ClassSymbol

    Definition Classes
    TypeComparer
  9. def ObjectClass: ClassSymbol

    Definition Classes
    TypeComparer
  10. def addConstraint(param: PolyParam, bound: Type, fromBelow: Boolean): Boolean

    Add constraint param <: bound if fromBelow is false, param >: bound otherwise.

    Add constraint param <: bound if fromBelow is false, param >: bound otherwise. bound is assumed to be in normalized form, as specified in firstTry and secondTry of TypeComparer. In particular, it should not be an alias type, lazy ref, typevar, wildcard type, error type. In addition, upper bounds may not be AndTypes and lower bounds may not be OrTypes. This is assured by the way isSubType is organized.

    Definition Classes
    ExplainingTypeComparerConstraintHandling
  11. def addLess(p1: PolyParam, p2: PolyParam): Boolean

    Attributes
    protected
    Definition Classes
    ConstraintHandling
  12. def addLowerBound(param: PolyParam, bound: Type): Boolean

    Attributes
    protected
    Definition Classes
    ConstraintHandling
  13. def addToConstraint(pt: PolyType, tvars: List[TypeVar]): Unit

    Add polytype pt, possibly with type variables tvars, to current constraint and propagate all bounds.

    Add polytype pt, possibly with type variables tvars, to current constraint and propagate all bounds.

    tvars

    See Constraint#add

    Definition Classes
    ConstraintHandling
  14. def addUpperBound(param: PolyParam, bound: Type): Boolean

    Attributes
    protected
    Definition Classes
    ConstraintHandling
  15. final def andType(tp1: Type, tp2: Type, erased: Boolean = ctx.erasedTypes): Type

    Form a normalized conjunction of two types.

    Form a normalized conjunction of two types. Note: For certain types, & is distributed inside the type. This holds for all types which are not value types (e.g. TypeBounds, ClassInfo, ExprType, MethodType, PolyType). Also, when forming an &, instantiated TypeVars are dereferenced and annotations are stripped. Finally, refined types with the same refined name are opportunistically merged.

    Sometimes, the conjunction of two types cannot be formed because the types are in conflict of each other. In particular:

    1. Two different class types are conflicting. 2. A class type conflicts with a type bounds that does not include the class reference. 3. Two method or poly types with different (type) parameters but the same signature are conflicting

    In these cases, a MergeError is thrown.

    Definition Classes
    TypeComparer
  16. final def approximation(param: PolyParam, fromBelow: Boolean): Type

    Solve constraint set for given type parameter param.

    Solve constraint set for given type parameter param. If fromBelow is true the parameter is approximated by its lower bound, otherwise it is approximated by its upper bound. However, any occurrences of the parameter in a refinement somewhere in the bound are removed. (Such occurrences can arise for F-bounded types). The constraint is left unchanged.

    returns

    the instantiating type

    Definition Classes
    ConstraintHandling
  17. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  18. final def bounds(param: PolyParam): TypeBounds

    The current bounds of type parameter param

    The current bounds of type parameter param

    Definition Classes
    ConstraintHandling
  19. final def canConstrain(param: PolyParam): Boolean

    Can param be constrained with new bounds?

    Can param be constrained with new bounds?

    Definition Classes
    ConstraintHandling
  20. def checkPropagated(msg: ⇒ String)(result: Boolean): Boolean

    Check that constraint is fully propagated.

    Check that constraint is fully propagated. See comment in Config.checkConstraintsPropagated

    Definition Classes
    ConstraintHandling
  21. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. def compareHkApply(projection: NamedType, other: Type, inOrder: Boolean): Boolean

    If projection is a hk projection T#$apply with a constrainable poly param as type constructor and other is not a hk projection, then perform the following steps:

    If projection is a hk projection T#$apply with a constrainable poly param as type constructor and other is not a hk projection, then perform the following steps:

    (1) If not inOrder then perform the next steps until they all succeed for each base type of other which

    • derives from a class bound of projection,
    • has the same number of type parameters than projection
    • has type parameter variances which conform to those of projection. If inOrder then perform the same steps on the original other type.

    (2) Try to eta expand the constructor of other.

    (3a) In mode TypevarsMissConetxt replace the projection's hk constructor parameter by the eta expansion of step (2) reapplied to the projection's arguments. (3b) In normal mode, try to unify the projection's hk constructor parameter with the eta expansion of step(2)

    (4) If inOrder, test projection <: other else test other <: projection.

    Definition Classes
    ExplainingTypeComparerTypeComparer
  23. def compareHkLambda(rt: RefinedType, other: Type, inOrder: Boolean): Boolean

    Compare type lambda with non-lambda type.

    Compare type lambda with non-lambda type.

    Definition Classes
    ExplainingTypeComparerTypeComparer
  24. def copyIn(ctx: Context): ExplainingTypeComparer

    A new type comparer of the same type as this one, using the given context.

    A new type comparer of the same type as this one, using the given context.

    Definition Classes
    ExplainingTypeComparerTypeComparer
  25. implicit val ctx: Context

    Definition Classes
    TypeComparerConstraintHandling
  26. final def ensureStableSingleton(tp: Type): SingletonType

    Definition Classes
    TypeComparer
  27. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  29. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  30. var frozenConstraint: Boolean

    If the constraint is frozen we cannot add new bounds to the constraint.

    If the constraint is frozen we cannot add new bounds to the constraint.

    Attributes
    protected
    Definition Classes
    ConstraintHandling
  31. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  32. def glb(tp1: Type, tp2: Type): Type

    The greatest lower bound of two types

    The greatest lower bound of two types

    Definition Classes
    ExplainingTypeComparerTypeComparer
  33. final def glb(tps: List[Type]): Type

    The greatest lower bound of a list types

    The greatest lower bound of a list types

    Definition Classes
    TypeComparer
  34. def hasMatchingMember(name: Name, tp1: Type, tp2: RefinedType): Boolean

    Does type tp1 have a member with name name whose normalized type is a subtype of the normalized type of the refinement tp2? Normalization is as follows: If tp2 contains a skolem to its refinement type, rebase both itself and the member info of tp on a freshly created skolem type.

    Does type tp1 have a member with name name whose normalized type is a subtype of the normalized type of the refinement tp2? Normalization is as follows: If tp2 contains a skolem to its refinement type, rebase both itself and the member info of tp on a freshly created skolem type.

    Definition Classes
    ExplainingTypeComparerTypeComparer
  35. def hashCode(): Int

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

    Definition Classes
    Any
  37. def isMatchedByProto(proto: ProtoType, tp: Type): Boolean

    Defer constraining type variables when compared against prototypes

    Defer constraining type variables when compared against prototypes

    Definition Classes
    TypeComparer
  38. def isSameRef(tp1: Type, tp2: Type): Boolean

    Same as isSameType but also can be applied to overloaded TermRefs, where two overloaded refs are the same if they have pairwise equal alternatives

    Same as isSameType but also can be applied to overloaded TermRefs, where two overloaded refs are the same if they have pairwise equal alternatives

    Definition Classes
    TypeComparer
  39. def isSameType(tp1: Type, tp2: Type): Boolean

    Two types are the same if are mutual subtypes of each other

    Two types are the same if are mutual subtypes of each other

    Definition Classes
    TypeComparerConstraintHandling
  40. final def isSameTypeWhenFrozen(tp1: Type, tp2: Type): Boolean

    Definition Classes
    ConstraintHandling
  41. final def isSatisfiable: Boolean

    Test whether the lower bounds of all parameters in this constraint are a solution to the constraint.

    Test whether the lower bounds of all parameters in this constraint are a solution to the constraint.

    Attributes
    protected
    Definition Classes
    ConstraintHandling
  42. def isSubType(tp1: Type, tp2: Type): Boolean

  43. final def isSubTypeWhenFrozen(tp1: Type, tp2: Type): Boolean

    Definition Classes
    ConstraintHandling
  44. def lub(tp1: Type, tp2: Type): Type

    The least upper bound of two types

    The least upper bound of two types

    Definition Classes
    ExplainingTypeComparerTypeComparer
    Note

    We do not admit singleton types in or-types as lubs.

  45. final def lub(tps: List[Type]): Type

    The least upper bound of a list of types

    The least upper bound of a list of types

    Definition Classes
    TypeComparer
  46. final def matchesType(tp1: Type, tp2: Type, relaxed: Boolean): Boolean

    A function implementing tp1 matches tp2.

    A function implementing tp1 matches tp2.

    Definition Classes
    TypeComparer
  47. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  48. final def notify(): Unit

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

    Definition Classes
    AnyRef
  50. final def orType(tp1: Type, tp2: Type, erased: Boolean = ctx.erasedTypes): Type

    Form a normalized conjunction of two types.

    Form a normalized conjunction of two types. Note: For certain types, | is distributed inside the type. This holds for all types which are not value types (e.g. TypeBounds, ClassInfo, ExprType, MethodType, PolyType). Also, when forming an |, instantiated TypeVars are dereferenced and annotations are stripped.

    Sometimes, the disjunction of two types cannot be formed because the types are in conflict of each other. (@see andType for an enumeration of these cases). In cases of conflict a MergeError is raised.

    erased

    Apply erasure semantics. If erased is true, instead of creating an OrType, the lub will be computed using TypeCreator#erasedLub.

    Definition Classes
    TypeComparer
  51. def recordStatistics(result: Boolean, prevSuccessCount: Int): Unit

    Record statistics about the total number of subtype checks and the number of "successful" subtype checks, i.e.

    Record statistics about the total number of subtype checks and the number of "successful" subtype checks, i.e. checks that form part of a subtype derivation tree that's ultimately successful.

    Definition Classes
    TypeComparer
  52. def showGoal(tp1: Type, tp2: Type)(implicit ctx: Context): Unit

    Show subtype goal that led to an assertion failure

    Show subtype goal that led to an assertion failure

    Definition Classes
    TypeComparer
  53. val state: TyperState

    Definition Classes
    TypeComparerConstraintHandling
  54. final def subsumes(c1: Constraint, c2: Constraint, pre: Constraint): Boolean

    Constraint c1 subsumes constraint c2, if under c2 as constraint we have for all poly params p defined in c2 as p >: L2 <: U2:

    Constraint c1 subsumes constraint c2, if under c2 as constraint we have for all poly params p defined in c2 as p >: L2 <: U2:

    c1 defines p with bounds p >: L1 <: U1, and L2 <: L1, and U1 <: U2

    Both c1 and c2 are required to derive from constraint pre, possibly narrowing it with further bounds.

    Attributes
    protected
    Definition Classes
    ConstraintHandling
  55. def subtypeCheckInProgress: Boolean

    Is a subtype check in progress? In that case we may not permanently instantiate type variables, because the corresponding constraint might still be retracted and the instantiation should then be reversed.

    Is a subtype check in progress? In that case we may not permanently instantiate type variables, because the corresponding constraint might still be retracted and the instantiation should then be reversed.

    Definition Classes
    TypeComparer
  56. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  57. def toString(): String

    Definition Classes
    ExplainingTypeComparer → AnyRef → Any
  58. def topLevelSubType(tp1: Type, tp2: Type): Boolean

    Definition Classes
    TypeComparer
  59. def traceIndented[T](str: String)(op: ⇒ T): T

    A hook for showing subtype traces.

    A hook for showing subtype traces. Overridden in ExplainingTypeComparer

    Definition Classes
    ExplainingTypeComparerTypeComparer
  60. def tryInstantiate(param: PolyParam, tp: Type): Boolean

    Instantiate param to tp if the constraint stays satisfiable

    Instantiate param to tp if the constraint stays satisfiable

    Attributes
    protected
    Definition Classes
    ConstraintHandling
  61. def unsupported(methodName: String): Nothing

    Throws an UnsupportedOperationException with the given method name.

    Throws an UnsupportedOperationException with the given method name.

    Definition Classes
    DotClass
  62. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from TypeComparer

Inherited from ConstraintHandling

Inherited from DotClass

Inherited from AnyRef

Inherited from Any

Ungrouped