File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
compiler/src/dotty/tools/dotc/core
tests/pos-custom-args/captures Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -826,7 +826,11 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
826
826
if refs1.isAlwaysEmpty then recur(tp1, parent2)
827
827
else subCaptures(refs1, refs2, frozenConstraint).isOK
828
828
&& sameBoxed(tp1, tp2, refs1)
829
- && recur(tp1.widen.stripCapturing, parent2)
829
+ && (recur(tp1.widen.stripCapturing, parent2)
830
+ || tp1.isInstanceOf [SingletonType ] && recur(tp1, parent2)
831
+ // this alternative is needed in case the right hand side is a
832
+ // capturing type that contains the lhs as an |-alternative.
833
+ )
830
834
catch case ex : AssertionError =>
831
835
println(i " assertion failed while compare captured $tp1 <:< $tp2" )
832
836
throw ex
Original file line number Diff line number Diff line change
1
+ class Denotation
2
+ abstract class SingleDenotation extends Denotation
3
+ def goRefined : Denotation =
4
+ val foo : Denotation = ???
5
+ val joint = foo
6
+ joint match
7
+ case joint : SingleDenotation =>
8
+ joint
9
+ case _ =>
10
+ joint
You can’t perform that action at this time.
0 commit comments