@@ -1813,11 +1813,6 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {
1813
1813
}
1814
1814
1815
1815
object alignPatterns extends ScalacPatternExpander {
1816
- /** Converts a T => (A, B, C) extractor to a T => ((A, B, CC)) extractor.
1817
- */
1818
- def tupleExtractor (extractor : Extractor ): Extractor =
1819
- extractor.copy(fixed = defn.tupleType(extractor.fixed) :: Nil )
1820
-
1821
1816
private def validateAligned (tree : Tree , aligned : Aligned ): Aligned = {
1822
1817
import aligned ._
1823
1818
@@ -1859,29 +1854,13 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {
1859
1854
}
1860
1855
val patterns = newPatterns(args)
1861
1856
val isSeq = sel.symbol.name == nme.unapplySeq
1862
- val isUnapply = sel.symbol.name == nme.unapply
1863
1857
val extractor = sel.symbol.name match {
1864
1858
case nme.unapply => unapplyMethodTypes(tree, /* fn*/ sel, args, resultType, isSeq = false )
1865
1859
case nme.unapplySeq => unapplyMethodTypes(tree, /* fn*/ sel, args, resultType, isSeq = true )
1866
1860
case _ => applyMethodTypes(/* fn*/ sel.tpe)
1867
1861
}
1868
1862
1869
- /** Rather than let the error that is SI-6675 pollute the entire matching
1870
- * process, we will tuple the extractor before creation Aligned so that
1871
- * it contains known good values.
1872
- */
1873
- def prodArity = extractor.prodArity
1874
- def acceptMessage = if (extractor.isErroneous) " " else s " to hold ${extractor.offeringString}"
1875
- val requiresTupling = isUnapply && patterns.totalArity == 1 && prodArity > 1
1876
-
1877
- // if (requiresTupling && effectivePatternArity(args) == 1)
1878
- // currentUnit.deprecationWarning(sel.pos, s"${sel.symbol.owner} expects $prodArity patterns$acceptMessage but crushing into $prodArity-tuple to fit single pattern (SI-6675)")
1879
-
1880
- val normalizedExtractor =
1881
- if (requiresTupling)
1882
- tupleExtractor(extractor)
1883
- else extractor
1884
- validateAligned(fn, Aligned (patterns, normalizedExtractor))
1863
+ validateAligned(fn, Aligned (patterns, extractor))
1885
1864
}
1886
1865
1887
1866
def apply (tree : Tree , resultType : Type ): Aligned = tree match {
0 commit comments