diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-03-25 20:29:16 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-03-25 20:29:16 +0100 |
commit | b8807ca85d08d56afd4f44143481608dae32db34 (patch) | |
tree | 3d4b69b04110054ac789eb8c94edae2f4813aaec /src/dotty/tools/dotc/transform/PatternMatcher.scala | |
parent | ed1de3a26e00e5b7f4113ce32fa00c2f992deafa (diff) | |
download | dotty-b8807ca85d08d56afd4f44143481608dae32db34.tar.gz dotty-b8807ca85d08d56afd4f44143481608dae32db34.tar.bz2 dotty-b8807ca85d08d56afd4f44143481608dae32db34.zip |
Fix #431: Options make 2 steps of decoding instead of one
Diffstat (limited to 'src/dotty/tools/dotc/transform/PatternMatcher.scala')
-rw-r--r-- | src/dotty/tools/dotc/transform/PatternMatcher.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/transform/PatternMatcher.scala b/src/dotty/tools/dotc/transform/PatternMatcher.scala index ea41e7592..3c304ccec 100644 --- a/src/dotty/tools/dotc/transform/PatternMatcher.scala +++ b/src/dotty/tools/dotc/transform/PatternMatcher.scala @@ -1556,7 +1556,13 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans //val spr = subPatRefs(binder) assert(go && go1) ref(binder) :: Nil - } else subPatRefs(binder) + } else { + lazy val getTp = extractorMemberType(binderTypeTested, nme.get) + if ((aligner.isSingle && aligner.extractor.prodArity == 1) && ((extractorMemberType(binderTypeTested, nme.isDefined) isRef defn.BooleanClass) && getTp.exists)) + List(ref(binder)) + else + subPatRefs(binder) + } } /*protected def spliceApply(binder: Symbol): Tree = { |