File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -692,9 +692,10 @@ object PatternMatcher {
692692 val scrutinee = plan.scrutinee
693693 (plan.test: @ unchecked) match {
694694 case NonEmptyTest =>
695- scrutinee
696- .select(nme.isEmpty, _.info.isParameterless)
697- .select(nme.UNARY_! , _.info.isParameterless)
695+ constToLiteral(
696+ scrutinee
697+ .select(nme.isEmpty, _.info.isParameterless)
698+ .select(nme.UNARY_! , _.info.isParameterless))
698699 case NonNullTest =>
699700 scrutinee.testNotNull
700701 case GuardTest =>
Original file line number Diff line number Diff line change 1+ package example
2+
3+ class Extractor [A ](val get : A ) extends AnyVal {
4+ // https://github.com/scala/scala/pull/9343
5+ def isEmpty : false = false
6+ }
7+
8+ object Foo {
9+ def unapply (x : String ): Extractor [String ] = new Extractor (x)
10+ }
11+
12+ object Main {
13+ val Foo (a) = " a"
14+ }
You can’t perform that action at this time.
0 commit comments