MatchTypeTrace

dotty.tools.dotc.core.MatchTypeTrace

A utility module to produce match type reduction traces in error messages.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def caseText(tp: Type)(using Context): String
def emptyScrutinee(scrut: Type)(using Context): Unit

Record a failure that scrutinee scrut is provably empty. Only the first failure is recorded.

Record a failure that scrutinee scrut is provably empty. Only the first failure is recorded.

Attributes

def illegalPatternText(scrut: Type, cas: LegacyPatMat)(using Context): String

Are we running an operation that records a match type trace?

Are we running an operation that records a match type trace?

Attributes

def noInstance(scrut: Type, stuckCase: MatchTypeCaseSpec, fails: List[(Name, TypeBounds)])(using Context): Unit
def noMatchesText(scrut: Type, cases: List[MatchTypeCaseSpec])(using Context): String

The failure message when the scrutinee scrut does not match any case in cases.

The failure message when the scrutinee scrut does not match any case in cases.

Attributes

def record(op: Context ?=> Any)(using Context): String

Execute op and if it involves a failed match type reduction return the trace of that reduction. Otherwise return the empty string.

Execute op and if it involves a failed match type reduction return the trace of that reduction. Otherwise return the empty string.

Attributes

def recurseWith(scrut: Type)(op: => Type)(using Context): Type

Record in the trace that we are trying to reduce scrut when performing op If op succeeds the entry is removed after exit. If op fails, it stays.

Record in the trace that we are trying to reduce scrut when performing op If op succeeds the entry is removed after exit. If op fails, it stays.

Attributes

def stuck(scrut: Type, stuckCase: MatchTypeCaseSpec, otherCases: List[MatchTypeCaseSpec])(using Context): Unit

Record a failure that scrutinee scrut does not match stuckCase but is not disjoint from it either, which means that the remaining cases otherCases cannot be visited. Only the first failure is recorded.

Record a failure that scrutinee scrut does not match stuckCase but is not disjoint from it either, which means that the remaining cases otherCases cannot be visited. Only the first failure is recorded.

Attributes