Dotty Documentation

0.14.0-bin-SNAPSHOT

class SpaceEngine
extends Object with SpaceLogic

Scala implementation of space logic

[-] Constructors

SpaceEngine ( )
SpaceEngine ( implicit ctx: Context )

[-] Members

[+] private implicit val ctx : Context
[+] private val nullSpace : Typ
[+] private val nullType : ConstantType
[+] private val scalaConsType : TypeRef
[+] private val scalaListType : TypeRef
[+] private val scalaNilType : TermRef
[+] private val scalaSeqFactoryClass : ClassSymbol
[+] private val scalaSomeClass : ClassSymbol
[+] def canDecompose ( tp: Type ) : Boolean

Abstract sealed types, or-types, Boolean and Java enums can be decomposed

[+] def checkExhaustivity ( _match: Match ) : Unit
[+] def checkRedundancy ( _match: Match ) : Unit
[+] def decompose ( tp: Type ) : List [ Space ]

Decompose a type into subspaces -- assume the type can be decomposed

[+] def erase ( tp: Type ) : Type
[+] private def exhaustivityCheckable ( sel: Tree ) : Boolean
[+] override def intersectUnrelatedAtomicTypes ( tp1: Type , tp2: Type ) : Space

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).

[+] def irrefutable ( unapp: Tree ) : Boolean

Whether the extractor is irrefutable

[+] def isEqualType ( tp1: Type , tp2: Type ) : Boolean

Is tp1 the same type as tp2?

[+] def isSubType ( tp1: Type , tp2: Type ) : Boolean

Is tp1 a subtype of tp2?

[+] def project ( pat: Tree ) : Space

Return the space that represents the pattern pat

[+] def projectSeq ( pats: List [ Tree ] ) : Space

Space of the pattern: unapplySeq(a, b, c: _*)

[+] private def redundancyCheckable ( sel: Tree ) : Boolean
[+] def satisfiable ( sp: Space ) : Boolean

Whether the counterexample is satisfiable. The space is flattened and non-empty.

[+] private def shouldCheckExamples ( tp: Type ) : Boolean

Whehter counter-examples should be further checked? True for GADTs.

[+] def show ( s: Space ) : String

Display spaces

[+] def showType ( tp: Type ) : String

Show friendly type name with current scope in mind

E.g. C.this.B --> B if current owner is C C.this.x.T --> x.T if current owner is C X[T] --> X C --> C if current owner is C !!!

[+] def signature ( unapp: Type , unappSym: Symbol , argLen: Int ) : List [ Type ]

Parameter types of the case class type tp. Adapted from unapplyPlan in patternMatcher

[+] private def unapplySeqInfo ( resTp: Type , pos: SourcePosition ) ( implicit ctx: Context ) : ( Int, Type, Type )