case class
TypeTestTreeMaker
extends
CondTreeMaker
implements the run-time aspects of (§8.2) (typedPattern has already done the necessary type transformations)
Type patterns consist of types, type variables, and wildcards. A type pattern T is of one of the following forms: - A reference to a class C, p.C, or T#C. This type pattern matches any non-null instance of the given class. Note that the prefix of the class, if it is given, is relevant for determining class instances. For instance, the pattern p.C matches only instances of classes C which were created with the path p as prefix. The bottom types scala.Nothing and scala.Null cannot be used as type patterns, because they would match nothing in any case.
- A singleton type p.type.
This type pattern matches only the value denoted by the path p
(that is, a pattern match involved a comparison of the matched value with p using method eq in class AnyRef). // TODO: the actual pattern matcher uses ==, so that's what I'm using for now
// https://issues.scala-lang.org/browse/SI-4577 "pattern matcher, still disappointing us at equality time"
- A compound type pattern T1 with ... with Tn where each Ti is a type pat- tern.
This type pattern matches all values that are matched by each of the type patterns Ti.
- A parameterized type pattern T[a1,...,an], where the ai are type variable patterns or wildcards _.
This type pattern matches all values which match T for some arbitrary instantiation of the type variables and wildcards.
The bounds or alias type of these type variable are determined as described in (§8.3).
- A parameterized type pattern scala.Array[T1], where T1 is a type pattern. // TODO
This type pattern matches any non-null instance of type scala.Array[U1], where U1 is a type matched by T1.
Constructors
TypeTestTreeMaker
(
afterTest:
Symbol
,
testedBinder:
Symbol
,
expectedTp:
Type
,
nextBinderTp:
Type
)
TypeTestTreeMaker
(
pos:
Position
,
extractorArgTypeTest:
Boolean
)
Members
private
val
extractorArgTypeTest
: Boolean
override lazy
val
introducedRebindings
: Rebindings
override
val
pos
: Position
def
_1
: T1
def
_2
: T2
def
_3
: T3
def
_4
: T4
def
copy
(
afterTest:
Symbol
,
testedBinder:
Symbol
,
expectedTp:
Type
,
nextBinderTp:
Type
)
(
pos:
Position
,
extractorArgTypeTest:
Boolean
)
: TypeTestTreeMaker
def
outerTestNeeded
: Boolean
def
renderCondition
(
cs:
TypeTestCondStrategy
)
: Result
override
def
toString
: String