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 {
281281 (unapp.symbol.is(Synthetic ) && unapp.symbol.owner.linkedClass.is(Case )) || // scala2 compatibility
282282 (patSize != - 1 && productArity(unappResult) == patSize) || {
283283 val isEmptyTp = extractorMemberType(unappResult, nme.isEmpty, unapp.sourcePos)
284- isEmptyTp <:< ConstantType (Constant (true ))
284+ isEmptyTp <:< ConstantType (Constant (false ))
285285 }
286286 }
287287
@@ -296,7 +296,7 @@ object SpaceEngine {
296296 isProductSeqMatch(unappResult, patSize) ||
297297 {
298298 val isEmptyTp = extractorMemberType(unappResult, nme.isEmpty, unapp.sourcePos)
299- isEmptyTp <:< ConstantType (Constant (true ))
299+ isEmptyTp <:< ConstantType (Constant (false ))
300300 }
301301 }
302302}
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