@@ -1376,8 +1376,8 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
1376
1376
1377
1377
def subPatTypes : List [Type ] = typedPatterns map (_.tpe)
1378
1378
1379
- // there are `productArity ` non-seq elements in the tuple.
1380
- protected def firstIndexingBinder = productArity
1379
+ // there are `prodArity ` non-seq elements in the tuple.
1380
+ protected def firstIndexingBinder = prodArity
1381
1381
protected def expectedLength = elementArity
1382
1382
protected def lastIndexingBinder = totalArity - starArity - 1
1383
1383
@@ -1535,7 +1535,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
1535
1535
// the trees that select the subpatterns on the extractor's result, referenced by `binder`
1536
1536
// require (totalArity > 0 && (!lastIsStar || isSeq))
1537
1537
protected def subPatRefs (binder : Symbol , subpatBinders : List [Symbol ], binderTypeTested : Type ): List [Tree ] = {
1538
- if (aligner.isSingle && aligner.extractor.productArity == 1 && defn.isTupleType(binder.info)) {
1538
+ if (aligner.isSingle && aligner.extractor.prodArity == 1 && defn.isTupleType(binder.info)) {
1539
1539
// special case for extractor
1540
1540
// comparing with scalac additional assertions added
1541
1541
val subpw = subpatBinders.head.info.widen
@@ -1577,13 +1577,13 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
1577
1577
*
1578
1578
* Here Pm/Fi is the last pattern to match the fixed arity section.
1579
1579
*
1580
- * productArity : the value of i, i.e. the number of non-sequence types in the extractor
1580
+ * prodArity : the value of i, i.e. the number of non-sequence types in the extractor
1581
1581
* nonStarArity: the value of j, i.e. the number of non-star patterns in the case definition
1582
1582
* elementArity: j - i, i.e. the number of non-star patterns which must match sequence elements
1583
1583
* starArity: 1 or 0 based on whether there is a star (sequence-absorbing) pattern
1584
1584
* totalArity: nonStarArity + starArity, i.e. the number of patterns in the case definition
1585
1585
*
1586
- * Note that productArity is a function only of the extractor, and
1586
+ * Note that prodArity is a function only of the extractor, and
1587
1587
* nonStar/star/totalArity are all functions of the patterns. The key
1588
1588
* value for aligning and typing the patterns is elementArity, as it
1589
1589
* is derived from both sets of information.
@@ -1651,7 +1651,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
1651
1651
final case class Extractor (whole : Type , fixed : List [Type ], repeated : Repeated ) {
1652
1652
require(whole != NoType , s " expandTypes( $whole, $fixed, $repeated) " )
1653
1653
1654
- def productArity = fixed.length
1654
+ def prodArity = fixed.length
1655
1655
def hasSeq = repeated.exists
1656
1656
def elementType = repeated.elementType
1657
1657
def sequenceType = repeated.sequenceType
@@ -1681,8 +1681,8 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
1681
1681
* < 0: There are more products than patterns: compile time error.
1682
1682
*/
1683
1683
final case class Aligned (patterns : Patterns , extractor : Extractor ) {
1684
- def elementArity = patterns.nonStarArity - productArity
1685
- def productArity = extractor.productArity
1684
+ def elementArity = patterns.nonStarArity - prodArity
1685
+ def prodArity = extractor.prodArity
1686
1686
def starArity = patterns.starArity
1687
1687
def totalArity = patterns.totalArity
1688
1688
@@ -1693,15 +1693,15 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
1693
1693
def typedNonStarPatterns = products ::: elements
1694
1694
def typedPatterns = typedNonStarPatterns ::: stars
1695
1695
1696
- def isBool = ! isSeq && productArity == 0
1696
+ def isBool = ! isSeq && prodArity == 0
1697
1697
def isSingle = ! isSeq && totalArity == 1
1698
1698
def isStar = patterns.hasStar
1699
1699
def isSeq = extractor.hasSeq
1700
1700
1701
1701
private def typedAsElement (pat : Pattern ) = TypedPat (pat, extractor.elementType)
1702
1702
private def typedAsSequence (pat : Pattern ) = TypedPat (pat, extractor.sequenceType)
1703
- private def productPats = patterns.fixed take productArity
1704
- private def elementPats = patterns.fixed drop productArity
1703
+ private def productPats = patterns.fixed take prodArity
1704
+ private def elementPats = patterns.fixed drop prodArity
1705
1705
private def products = (productPats, productTypes).zipped map TypedPat
1706
1706
private def elements = elementPats map typedAsElement
1707
1707
private def stars = patterns.starPatterns map typedAsSequence
@@ -1710,7 +1710,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
1710
1710
|Aligned {
1711
1711
| patterns $patterns
1712
1712
| extractor $extractor
1713
- | arities $productArity / $elementArity/ $starArity // product/element/star
1713
+ | arities $prodArity / $elementArity/ $starArity // product/element/star
1714
1714
| typed ${typedPatterns mkString " , " }
1715
1715
|} """ .stripMargin.trim
1716
1716
}
@@ -1826,7 +1826,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
1826
1826
def offering = extractor.offeringString
1827
1827
def symString = tree.symbol.showLocated
1828
1828
def offerString = if (extractor.isErroneous) " " else s " offering $offering"
1829
- def arityExpected = ( if (extractor.hasSeq) " at least " else " " ) + productArity
1829
+ def arityExpected = ( if (extractor.hasSeq) " at least " else " " ) + prodArity
1830
1830
1831
1831
def err (msg : String ) = ctx.error(msg, tree.pos)
1832
1832
def warn (msg : String ) = ctx.warning(msg, tree.pos)
@@ -1871,12 +1871,12 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
1871
1871
* process, we will tuple the extractor before creation Aligned so that
1872
1872
* it contains known good values.
1873
1873
*/
1874
- def productArity = extractor.productArity
1874
+ def prodArity = extractor.prodArity
1875
1875
def acceptMessage = if (extractor.isErroneous) " " else s " to hold ${extractor.offeringString}"
1876
- val requiresTupling = isUnapply && patterns.totalArity == 1 && productArity > 1
1876
+ val requiresTupling = isUnapply && patterns.totalArity == 1 && prodArity > 1
1877
1877
1878
1878
// if (requiresTupling && effectivePatternArity(args) == 1)
1879
- // currentUnit.deprecationWarning(sel.pos, s"${sel.symbol.owner} expects $productArity patterns$acceptMessage but crushing into $productArity -tuple to fit single pattern (SI-6675)")
1879
+ // currentUnit.deprecationWarning(sel.pos, s"${sel.symbol.owner} expects $prodArity patterns$acceptMessage but crushing into $prodArity -tuple to fit single pattern (SI-6675)")
1880
1880
1881
1881
val normalizedExtractor =
1882
1882
if (requiresTupling)
0 commit comments