File tree 3 files changed +20
-3
lines changed
compiler/src/dotty/tools/dotc/typer
3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -590,7 +590,7 @@ object RefChecks {
590
590
clazz.nonPrivateMembersNamed(mbr.name)
591
591
.filterWithPredicate(
592
592
impl => isConcrete(impl.symbol)
593
- && mbrDenot.matchesLoosely(impl, alwaysCompareTypes = true ))
593
+ && withMode( Mode . IgnoreCaptures )( mbrDenot.matchesLoosely(impl, alwaysCompareTypes = true ) ))
594
594
.exists
595
595
596
596
/** The term symbols in this class and its baseclasses that are
@@ -737,7 +737,7 @@ object RefChecks {
737
737
def checkNoAbstractDecls (bc : Symbol ): Unit = {
738
738
for (decl <- bc.info.decls)
739
739
if (decl.is(Deferred )) {
740
- val impl = decl.matchingMember(clazz.thisType)
740
+ val impl = withMode( Mode . IgnoreCaptures )( decl.matchingMember(clazz.thisType) )
741
741
if (impl == NoSymbol || decl.owner.isSubClass(impl.owner))
742
742
&& ! ignoreDeferred(decl)
743
743
then
Original file line number Diff line number Diff line change 8
8
class C
9
9
10
10
def test (io : {* } IO ) = {
11
- class B extends A [{io} C ] { // X =:= {io} C // error
11
+ class B extends A [{io} C ] { // X =:= {io} C
12
12
override def foo (x : {io} C ): {io} C = ??? // error
13
13
}
14
14
}
Original file line number Diff line number Diff line change
1
+ import language .experimental .captureChecking
2
+
3
+ class IO
4
+
5
+ abstract class A [X ] {
6
+ def foo (x : Unit ): X
7
+ def bar (op : X => Int ): Int
8
+ }
9
+
10
+ class C
11
+
12
+ def test (io : {* } IO ) = {
13
+ class B extends A [{io} C ] { // X =:= {io} C
14
+ def foo (x : Unit ): {io} C = ???
15
+ def bar (op : ({io} C ) => Int ): Int = 0
16
+ }
17
+ }
You can’t perform that action at this time.
0 commit comments