aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2017-03-30 21:52:37 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2017-03-30 21:52:37 +0200
commitc5031a7c27d7b714a7ff917ba539a077e4ec215d (patch)
treefe9234e74eb10f13fcc97cab72d7d665f63f274b /compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala
parent88bac0ec158454b683eb04919da91838b627e424 (diff)
downloaddotty-c5031a7c27d7b714a7ff917ba539a077e4ec215d.tar.gz
dotty-c5031a7c27d7b714a7ff917ba539a077e4ec215d.tar.bz2
dotty-c5031a7c27d7b714a7ff917ba539a077e4ec215d.zip
PatMat: get rid of unnecessary forwarder
Diffstat (limited to 'compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala10
1 files changed, 2 insertions, 8 deletions
diff --git a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala
index e9bee96ca..8d25175f2 100644
--- a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala
+++ b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala
@@ -848,10 +848,10 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {
val nextBinder = afterTest.asTerm
- def needsOuterTest(patType: Type, selType: Type, currentOwner: Symbol): Boolean = {
+ def outerTestNeeded(implicit ctx: Context): Boolean = {
// See the test for SI-7214 for motivation for dealias. Later `treeCondStrategy#outerTest`
// generates an outer test based on `patType.prefix` with automatically dealises.
- patType.dealias match {
+ expectedTp.dealias match {
case tref @ TypeRef(pre, name) =>
(pre ne NoPrefix) && tref.symbol.isClass &&
ExplicitOuter.needsOuterIfReferenced(tref.symbol.asClass)
@@ -862,12 +862,6 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {
override lazy val introducedRebindings = NoRebindings
- def outerTestNeeded = {
- /*val np = expectedTp.normalizedPrefix
- val ts = np.termSymbol
- (ts ne NoSymbol) && */needsOuterTest(expectedTp, testedBinder.info, ctx.owner)
- }
-
// the logic to generate the run-time test that follows from the fact that
// a `prevBinder` is expected to have type `expectedTp`
// the actual tree-generation logic is factored out, since the analyses generate Cond(ition)s rather than Trees