diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2017-04-11 12:01:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-11 12:01:17 +0200 |
commit | 4868fb29580a67c7a1560d5c1c7cc658e2634359 (patch) | |
tree | 1deed7fb92912f09b810e905e351fe4cd796cc6b /compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala | |
parent | 579571e05a08120133173933e7eaf2555846d1d7 (diff) | |
parent | 198b5cec531a8e0d6c121cc425e19a54b7818868 (diff) | |
download | dotty-4868fb29580a67c7a1560d5c1c7cc658e2634359.tar.gz dotty-4868fb29580a67c7a1560d5c1c7cc658e2634359.tar.bz2 dotty-4868fb29580a67c7a1560d5c1c7cc658e2634359.zip |
Merge pull request #1938 from dotty-staging/named-based-patmat
Change case class desugaring and decouple Products and name-based-pattern-matching
Diffstat (limited to 'compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala index d87412d93..41a1218eb 100644 --- a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala +++ b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala @@ -233,7 +233,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer { // next: MatchMonad[U] // returns MatchMonad[U] def flatMap(prev: Tree, b: Symbol, next: Tree): Tree = { - val resultArity = defn.productArity(b.info) + val resultArity = productArity(b.info) if (isProductMatch(prev.tpe, resultArity)) { val nullCheck: Tree = prev.select(defn.Object_ne).appliedTo(Literal(Constant(null))) ifThenElseZero( @@ -1408,7 +1408,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer { protected def seqTree(binder: Symbol) = tupleSel(binder)(firstIndexingBinder + 1) protected def tupleSel(binder: Symbol)(i: Int): Tree = { val accessors = - if (defn.isProductSubType(binder.info)) + if (Applications.canProductMatch(binder.info)) productSelectors(binder.info) else binder.caseAccessors val res = |