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/typer/Typer.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/typer/Typer.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/typer/Typer.scala | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index e6236d122..ba55dfe30 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -762,10 +762,9 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit /** Is `formal` a product type which is elementwise compatible with `params`? */ def ptIsCorrectProduct(formal: Type) = { - val pclass = defn.ProductNType(params.length).symbol isFullyDefined(formal, ForceDegree.noBottom) && - formal.derivesFrom(pclass) && - formal.baseArgTypes(pclass).corresponds(params) { + Applications.canProductMatch(formal) && + Applications.productSelectorTypes(formal).corresponds(params) { (argType, param) => param.tpt.isEmpty || argType <:< typedAheadType(param.tpt).tpe } |