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 @@ -282,7 +282,7 @@ object SpaceEngine {
282282 (unapp.symbol.is(Synthetic ) && unapp.symbol.owner.linkedClass.is(Case )) || // scala2 compatibility
283283 (patSize != - 1 && productArity(unappResult) == patSize) || {
284284 val isEmptyTp = extractorMemberType(unappResult, nme.isEmpty, unapp.sourcePos)
285- isEmptyTp <:< ConstantType (Constant (true ))
285+ isEmptyTp <:< ConstantType (Constant (false ))
286286 }
287287 }
288288
@@ -297,7 +297,7 @@ object SpaceEngine {
297297 isProductSeqMatch(unappResult, patSize) ||
298298 {
299299 val isEmptyTp = extractorMemberType(unappResult, nme.isEmpty, unapp.sourcePos)
300- isEmptyTp <:< ConstantType (Constant (true ))
300+ isEmptyTp <:< ConstantType (Constant (false ))
301301 }
302302 }
303303}
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
5555- ` U = true `
5656- the extractor is used as a product match
5757- ` U = Some[T] ` (for Scala2 compatibility)
58- - ` U <: R ` and ` U <: { def isEmpty: true } `
58+ - ` U <: R ` and ` U <: { def isEmpty: false } `
5959
6060### Variadic Extractors
6161
@@ -88,7 +88,7 @@ A usage of a variadic extractor is irrefutable if one of the following condition
8888
8989- the extractor is used directly as a sequence match or product-sequence match
9090- ` U = Some[T] ` (for Scala2 compatibility)
91- - ` U <: R ` and ` U <: { def isEmpty: true } `
91+ - ` U <: R ` and ` U <: { def isEmpty: false } `
9292
9393## Boolean Match
9494
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ object ExProduct {
3636// isEmpty/get
3737
3838trait Res {
39- def isEmpty : true = true
39+ def isEmpty : false = false
4040 def get : Int
4141}
4242
You can’t perform that action at this time.
0 commit comments