File tree 3 files changed +5
-5
lines changed
compiler/src/dotty/tools/dotc/transform/patmat
docs/docs/reference/changed-features
3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ object SpaceEngine {
292
292
(unapp.symbol.is(Synthetic ) && unapp.symbol.owner.linkedClass.is(Case )) || // scala2 compatibility
293
293
(patSize != - 1 && productArity(unappResult) == patSize) || {
294
294
val isEmptyTp = extractorMemberType(unappResult, nme.isEmpty, unapp.sourcePos)
295
- isEmptyTp <:< ConstantType (Constant (true ))
295
+ isEmptyTp <:< ConstantType (Constant (false ))
296
296
}
297
297
}
298
298
@@ -307,7 +307,7 @@ object SpaceEngine {
307
307
isProductSeqMatch(unappResult, patSize) ||
308
308
{
309
309
val isEmptyTp = extractorMemberType(unappResult, nme.isEmpty, unapp.sourcePos)
310
- isEmptyTp <:< ConstantType (Constant (true ))
310
+ isEmptyTp <:< ConstantType (Constant (false ))
311
311
}
312
312
}
313
313
}
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ A usage of a fixed-arity extractor is irrefutable if one of the following condit
55
55
- ` U = true `
56
56
- the extractor is used as a product match
57
57
- ` U = Some[T] ` (for Scala2 compatibility)
58
- - ` U <: R ` and ` U <: { def isEmpty: true } `
58
+ - ` U <: R ` and ` U <: { def isEmpty: false } `
59
59
60
60
### Variadic Extractors
61
61
@@ -88,7 +88,7 @@ A usage of a variadic extractor is irrefutable if one of the following condition
88
88
89
89
- the extractor is used directly as a sequence match or product-sequence match
90
90
- ` U = Some[T] ` (for Scala2 compatibility)
91
- - ` U <: R ` and ` U <: { def isEmpty: true } `
91
+ - ` U <: R ` and ` U <: { def isEmpty: false } `
92
92
93
93
## Boolean Match
94
94
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ object ExProduct {
36
36
// isEmpty/get
37
37
38
38
trait Res {
39
- def isEmpty : true = true
39
+ def isEmpty : false = false
40
40
def get : Int
41
41
}
42
42
You can’t perform that action at this time.
0 commit comments