dotty.tools.dotc.transform.PatternMatcher.Translator.PatternExpander

Extractor

Related Doc: package PatternExpander

final case class Extractor(whole: Type, fixed: List[Type], repeated: Repeated) extends Product with Serializable

An 'extractor' can be a case class or an unapply or unapplySeq method. Decoding what it is that they extract takes place before we arrive here, so that this class can concentrate only on the relationship between patterns and types.

In a case class, the class is the unextracted type and the fixed and repeated types are derived from its constructor parameters.

In an unapply, this is reversed: the parameter to the unapply is the unextracted type, and the other types are derived based on the return type of the unapply method.

In other words, this case class and unapply are encoded the same:

case class Foo(x: Int, y: Int, zs: Char*) def unapplySeq(x: Foo): Option[(Int, Int, Seq[Char])]

Both are Extractor(Foo, Int :: Int :: Nil, Repeated(Seq[Char], Char, Char*))

whole

The type in its unextracted form

fixed

The non-sequence types which are extracted

repeated

The sequence type which is extracted

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Extractor
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Extractor(whole: Type, fixed: List[Type], repeated: Repeated)

    whole

    The type in its unextracted form

    fixed

    The non-sequence types which are extracted

    repeated

    The sequence type which is extracted

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. def allTypes: List[Type]

  5. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  6. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def elementType: Type

  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. val fixed: List[Type]

    The non-sequence types which are extracted

  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. def hasSeq: Boolean

  13. def isErroneous: Boolean

  14. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  18. def offeringString: String

  19. def prodArity: Int

  20. val repeated: Repeated

    The sequence type which is extracted

  21. def sequenceType: Type

  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  23. def toString(): String

    Definition Classes
    Extractor → AnyRef → Any
  24. def varargsTypes: List[Type]

  25. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. val whole: Type

    The type in its unextracted form

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped