SpaceLogic

dotty.tools.dotc.transform.patmat.SpaceLogic

abstract space logic

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Concise view

Value members

Abstract methods

Is the type tp decomposable? i.e. all values of the type can be covered by its decomposed types.

Is the type tp decomposable? i.e. all values of the type can be covered by its decomposed types.

Abstract sealed class, OrType, Boolean and Java enums can be decomposed.

Attributes

def covers(unapp: TermRef, scrutineeTp: Type, argLen: Int): Boolean

Whether the extractor covers the given type

Whether the extractor covers the given type

Attributes

def decompose(tp: Type): List[Typ]

Get components of decomposable types

Get components of decomposable types

Attributes

Return a space containing the values of both types.

Return a space containing the values of both types.

The types should be atomic (non-decomposable) and unrelated (neither should be a subtype of the other).

Attributes

True if we can assume that the two unapply methods are the same. That is, given the same parameter, they return the same result.

True if we can assume that the two unapply methods are the same. That is, given the same parameter, they return the same result.

We assume that unapply methods are pure, but the same method may be called with different prefixes, thus behaving differently.

Attributes

def isSubType(tp1: Type, tp2: Type): Boolean

Is tp1 a subtype of tp2?

Is tp1 a subtype of tp2?

Attributes

def show(sp: Space): String

Display space in string format

Display space in string format

Attributes

def signature(unapp: TermRef, scrutineeTp: Type, argLen: Int): List[Type]

Return term parameter types of the extractor unapp

Return term parameter types of the extractor unapp

Attributes

Concrete methods

def dedup(spaces: Seq[Space])(using Context): Seq[Space]

Remove a space if it's a subspace of remaining spaces

Remove a space if it's a subspace of remaining spaces

Note: dedup will return the same result if the sequence >= 10

Attributes

def flatten(space: Space)(using Context): Seq[Space]

Flatten space to get rid of Or for pretty print

Flatten space to get rid of Or for pretty print

Attributes

def intersect(a: Space, b: Space)(using Context): Space

Intersection of two spaces

Intersection of two spaces

Attributes

def isSubspace(a: Space, b: Space)(using Context): Boolean

Is a a subspace of b? Equivalent to a - b == Empty, but faster

Is a a subspace of b? Equivalent to a - b == Empty, but faster

Attributes

def minus(a: Space, b: Space)(using Context): Space

The space of a not covered by b

The space of a not covered by b

Attributes

def simplify(space: Space)(using Context): Space

Simplify space such that a space equal to Empty becomes Empty

Simplify space such that a space equal to Empty becomes Empty

Attributes