File tree 2 files changed +18
-3
lines changed
compiler/src/dotty/tools/dotc/transform 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -692,9 +692,10 @@ object PatternMatcher {
692
692
val scrutinee = plan.scrutinee
693
693
(plan.test: @ unchecked) match {
694
694
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))
698
699
case NonNullTest =>
699
700
scrutinee.testNotNull
700
701
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