MatchTypeTrace

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

class Object
trait Matchable
class Any

Value members

Concrete methods

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

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

def noMatches(scrut: Type, cases: List[Type])(using Context): Unit

Record a failure that scrutinee scrut does not match any case in cases. Only the first failure is recorded.

Record a failure that scrutinee scrut does not match any case in cases. Only the first failure is recorded.

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.

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.

def stuck(scrut: Type, stuckCase: Type, otherCases: List[Type])(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.