File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
compiler/src/dotty/tools/dotc/transform/patmat
docs/docs/reference/changed-features Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -281,7 +281,7 @@ object SpaceEngine {
281
281
(unapp.symbol.is(Synthetic ) && unapp.symbol.owner.linkedClass.is(Case )) || // scala2 compatibility
282
282
(patSize != - 1 && productArity(unappResult) == patSize) || {
283
283
val isEmptyTp = extractorMemberType(unappResult, nme.isEmpty, unapp.sourcePos)
284
- isEmptyTp <:< ConstantType (Constant (true ))
284
+ isEmptyTp <:< ConstantType (Constant (false ))
285
285
}
286
286
}
287
287
@@ -296,7 +296,7 @@ object SpaceEngine {
296
296
isProductSeqMatch(unappResult, patSize) ||
297
297
{
298
298
val isEmptyTp = extractorMemberType(unappResult, nme.isEmpty, unapp.sourcePos)
299
- isEmptyTp <:< ConstantType (Constant (true ))
299
+ isEmptyTp <:< ConstantType (Constant (false ))
300
300
}
301
301
}
302
302
}
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