Dotty Documentation


class ExplainingTypeComparer
extends TypeComparer

A type comparer that can record traces of subtype operations

[-] Constructors

ExplainingTypeComparer ( initctx: Context )

[-] Members

[+] private val b : StringBuilder
[+] private var indent : Int
[+] private val initctx : Context
[+] private var skipped : Boolean
[+] override def addConstraint ( param: TypeParamRef , bound: Type , fromBelow: Boolean ) ( implicit nc: AbsentContext ) : Boolean

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.

[+] override def copyIn ( ctx: Context ) : ExplainingTypeComparer

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

[+] override def glb ( tp1: Type , tp2: Type ) : Type

The greatest lower bound of two types

[+] override 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.

[+] override def isSubType ( tp1: Type , tp2: Type , approx: ApproxState ) : Boolean
[+] override def lastTrace ( ) : String

Returns last check's debug mode, if explicitly enabled.

[+] override def lub ( tp1: Type , tp2: Type , canConstrain: Boolean ) : Type

The least upper bound of two types

[+] def lub$default$3 : Boolean

The least upper bound of two types

[+] override def traceIndented ( str: String ) ( op: => T ) : T

A hook for showing subtype traces. Overridden in ExplainingTypeComparer