Abstract sealed types, or-types, Boolean and Java enums can be decomposed
Abstract sealed types, or-types, Boolean and Java enums can be decomposed
Decompose a type into subspaces -- assume the type can be decomposed
Decompose a type into subspaces -- assume the type can be decomposed
Expose refined type to eliminate reference to type variables
Expose refined type to eliminate reference to type variables
A = B M { type T = A } ~~> M { type T = B }
A <: X :> Y M { type T = A } ~~> M { type T <: X :> Y }
A <: X :> Y B <: U :> V M { type T <: A :> B } ~~> M { type T <: X :> V }
A = X B = Y M { type T <: A :> B } ~~> M { type T <: X :> Y }
Flatten space to get rid of Or
for pretty print
Flatten space to get rid of Or
for pretty print
Intersection of two spaces
Intersection of two spaces
Is tp1
the same type as tp2
?
Is tp1
the same type as tp2
?
Is tp1
a subtype of tp2
?
Is tp1
a subtype of tp2
?
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
The space of a not covered by b
The space of a not covered by b
Return the space that represents the pattern pat
Return the space that represents the pattern pat
If roundUp is true, approximate extractors to its type, otherwise approximate extractors to Empty
Refine tp2 based on tp1
Refine tp2 based on tp1
E.g. if tp1
is Option[Int]
, tp2
is Some
, then return
Some[Int]
.
If tp1
is path1.A
, tp2
is path2.B
, and path1
is subtype of
path2
, then return path1.B
.
Display spaces
Show friendly type name with current scope in mind
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 !!!
Parameter types of the case class type tp
Parameter types of the case class type tp
Simplify space using the laws, there's no nested union after simplify
Simplify space using the laws, there's no nested union after simplify
Scala implementation of space logic